@farm.js/core 0.1.0-beta.53 → 0.1.0-beta.55
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/{chunk-FCY7TXMA.mjs → chunk-2ISN27CV.mjs} +2 -2
- package/dist/{chunk-RPEYD7TD.mjs → chunk-BLTATPSB.mjs} +2 -2
- package/dist/{chunk-RPEYD7TD.mjs.map → chunk-BLTATPSB.mjs.map} +1 -1
- package/dist/{chunk-LN2BAU5H.mjs → chunk-MSQDIAQW.mjs} +2 -2
- package/dist/{chunk-GPHLXAFT.mjs → chunk-OGFWHBDO.mjs} +2 -2
- package/dist/{chunk-JECGLPIS.mjs → chunk-PYIVNTDI.mjs} +4 -4
- package/dist/{chunk-HAMMDSJM.mjs → chunk-RAZ7L3UY.mjs} +2 -2
- package/dist/{chunk-427JQ6OZ.mjs → chunk-YBHLSG7E.mjs} +54 -11
- package/dist/chunk-YBHLSG7E.mjs.map +1 -0
- package/dist/{chunk-BDHDDITP.mjs → chunk-ZP5IWDTE.mjs} +9 -8
- package/dist/chunk-ZP5IWDTE.mjs.map +1 -0
- package/dist/client/lifecycle.mjs +2 -2
- package/dist/client-plugins.cjs +1 -1
- package/dist/client-plugins.cjs.map +1 -1
- package/dist/client-plugins.mjs +2 -2
- package/dist/client.cjs +41 -12
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.mts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.mjs +11 -11
- package/dist/index.cjs +41 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +17 -17
- package/dist/internal/build-runtime.cjs +1 -1
- package/dist/internal/build-runtime.cjs.map +1 -1
- package/dist/internal/build-runtime.mjs +3 -3
- package/dist/internal/client-runtime.cjs +1 -1
- package/dist/internal/client-runtime.cjs.map +1 -1
- package/dist/internal/client-runtime.mjs +2 -2
- package/dist/navigation.cjs +40 -11
- package/dist/navigation.cjs.map +1 -1
- package/dist/navigation.mjs +4 -4
- package/dist/plugin.cjs +1 -1
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.mjs +2 -2
- package/dist/query/client.cjs +86 -7
- package/dist/query/client.cjs.map +1 -1
- package/dist/query/client.mjs +13 -7
- package/dist/query/client.mjs.map +1 -1
- package/dist/renderer-client.cjs +29 -9
- package/dist/renderer-client.cjs.map +1 -1
- package/dist/renderer-client.d.mts +1 -1
- package/dist/renderer-client.d.ts +1 -1
- package/dist/renderer-client.mjs +12 -9
- package/dist/renderer-client.mjs.map +1 -1
- package/dist/server.cjs +1 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.mjs +2 -2
- package/dist/{spa-router-BD7iUG-C.d.mts → spa-router-BV71GGW0.d.mts} +4 -3
- package/dist/{spa-router-swFKTqwR.d.ts → spa-router-BylM6JXm.d.ts} +4 -3
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.mjs +2 -2
- package/package.json +3 -3
- package/dist/chunk-427JQ6OZ.mjs.map +0 -1
- package/dist/chunk-BDHDDITP.mjs.map +0 -1
- /package/dist/{chunk-FCY7TXMA.mjs.map → chunk-2ISN27CV.mjs.map} +0 -0
- /package/dist/{chunk-LN2BAU5H.mjs.map → chunk-MSQDIAQW.mjs.map} +0 -0
- /package/dist/{chunk-GPHLXAFT.mjs.map → chunk-OGFWHBDO.mjs.map} +0 -0
- /package/dist/{chunk-JECGLPIS.mjs.map → chunk-PYIVNTDI.mjs.map} +0 -0
- /package/dist/{chunk-HAMMDSJM.mjs.map → chunk-RAZ7L3UY.mjs.map} +0 -0
|
@@ -227,7 +227,7 @@ import {
|
|
|
227
227
|
} from "./chunk-7ZMKVETU.mjs";
|
|
228
228
|
import {
|
|
229
229
|
FARM_VERSION
|
|
230
|
-
} from "./chunk-
|
|
230
|
+
} from "./chunk-BLTATPSB.mjs";
|
|
231
231
|
import {
|
|
232
232
|
__name,
|
|
233
233
|
__require
|
|
@@ -11371,4 +11371,4 @@ export {
|
|
|
11371
11371
|
farmPlugin,
|
|
11372
11372
|
defineConfig
|
|
11373
11373
|
};
|
|
11374
|
-
//# sourceMappingURL=chunk-
|
|
11374
|
+
//# sourceMappingURL=chunk-2ISN27CV.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// package.json
|
|
2
|
-
var version = "0.1.0-beta.
|
|
2
|
+
var version = "0.1.0-beta.55";
|
|
3
3
|
|
|
4
4
|
// src/version.ts
|
|
5
5
|
var FARM_VERSION = version;
|
|
@@ -7,4 +7,4 @@ var FARM_VERSION = version;
|
|
|
7
7
|
export {
|
|
8
8
|
FARM_VERSION
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=chunk-
|
|
10
|
+
//# sourceMappingURL=chunk-BLTATPSB.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json","../src/version.ts"],"sourcesContent":["{\n \"name\": \"@farm.js/core\",\n \"version\": \"0.1.0-beta.53\",\n \"description\": \"Core Farm.js framework for modern integrated apps\",\n \"keywords\": [\n \"@farm.js/core\",\n \"framework\",\n \"react\",\n \"rsc\",\n \"server-components\",\n \"ssr\",\n \"vite\"\n ],\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/farming-labs/farm.js\",\n \"directory\": \"packages/farm\"\n },\n \"files\": [\n \"dist\",\n \"types\"\n ],\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"typesVersions\": {\n \"*\": {\n \"middleware\": [\n \"./types/middleware.d.ts\",\n \"./dist/middleware.d.ts\"\n ],\n \"version\": [\n \"./dist/version.d.ts\"\n ],\n \"router\": [\n \"./dist/router.d.ts\"\n ],\n \"routes\": [\n \"./dist/routes.d.ts\"\n ],\n \"storage\": [\n \"./dist/storage.d.ts\"\n ],\n \"integrations\": [\n \"./dist/integrations.d.ts\"\n ],\n \"cache\": [\n \"./dist/cache.d.ts\"\n ],\n \"deferred\": [\n \"./dist/deferred.d.ts\"\n ],\n \"after\": [\n \"./dist/after.d.ts\"\n ],\n \"navigation\": [\n \"./dist/navigation.d.ts\"\n ],\n \"headers\": [\n \"./dist/headers.d.ts\"\n ],\n \"theme\": [\n \"./dist/theme/index.d.ts\"\n ],\n \"theme/client\": [\n \"./dist/theme/client.d.ts\"\n ],\n \"theme/runtime\": [\n \"./dist/theme/runtime.d.ts\"\n ],\n \"theme/server\": [\n \"./dist/theme/server.d.ts\"\n ],\n \"docs\": [\n \"./dist/docs.d.ts\"\n ],\n \"markdown\": [\n \"./dist/markdown.d.ts\"\n ],\n \"app-markdown\": [\n \"./dist/app-markdown.d.ts\"\n ],\n \"observability\": [\n \"./dist/observability.d.ts\"\n ],\n \"instrumentation\": [\n \"./dist/instrumentation.d.ts\"\n ],\n \"workflows\": [\n \"./dist/workflows.d.ts\"\n ],\n \"cron\": [\n \"./dist/cron.d.ts\"\n ],\n \"server-fn\": [\n \"./dist/server-fn.d.ts\"\n ],\n \"server-fn/client\": [\n \"./dist/server-fn-client.d.ts\"\n ],\n \"server-query\": [\n \"./dist/server-query.d.ts\"\n ],\n \"server-query/client\": [\n \"./dist/server-query-client.d.ts\"\n ],\n \"server-action-security\": [\n \"./dist/server-action-security.d.ts\"\n ],\n \"deployment\": [\n \"./dist/deployment.d.ts\"\n ],\n \"env\": [\n \"./dist/env.d.ts\"\n ],\n \"env-types\": [\n \"./dist/env-types.d.ts\"\n ],\n \"environment\": [\n \"./dist/environment.d.ts\"\n ],\n \"environment/vite\": [\n \"./dist/environment/vite.d.ts\"\n ],\n \"font\": [\n \"./dist/font.d.ts\"\n ],\n \"testing\": [\n \"./dist/testing.d.ts\"\n ],\n \"agent-runtime\": [\n \"./dist/agent-runtime.d.ts\"\n ],\n \"css\": [\n \"./types/css.d.ts\"\n ],\n \"image\": [\n \"./types/image.d.ts\",\n \"./dist/image.d.ts\"\n ],\n \"image/server\": [\n \"./dist/image/server.d.ts\"\n ],\n \"image/sharp\": [\n \"./dist/image/sharp.d.ts\"\n ],\n \"i18n\": [\n \"./dist/i18n/index.d.ts\"\n ],\n \"i18n/server\": [\n \"./dist/i18n/server.d.ts\"\n ],\n \"i18n/client\": [\n \"./dist/i18n/client.d.ts\"\n ],\n \"internal/production-runtime\": [\n \"./dist/internal/production-runtime.d.ts\"\n ],\n \"internal/metadata-image-runtime\": [\n \"./dist/internal/metadata-image-runtime.d.ts\"\n ],\n \"internal/client-runtime\": [\n \"./dist/internal/client-runtime.d.ts\"\n ],\n \"internal/build-runtime\": [\n \"./dist/internal/build-runtime.d.ts\"\n ],\n \"internal/config-runtime\": [\n \"./dist/internal/config-runtime.d.ts\"\n ],\n \"internal/production-node-env\": [\n \"./dist/internal/production-node-env.d.ts\"\n ],\n \"config\": [\n \"./dist/config.d.ts\"\n ],\n \"renderer\": [\n \"./dist/renderer.d.ts\"\n ],\n \"renderer-client\": [\n \"./dist/renderer-client.d.ts\"\n ],\n \"api\": [\n \"./types/api.d.ts\",\n \"./dist/api.d.ts\"\n ],\n \"api/route-manager\": [\n \"./dist/api/route-manager.d.ts\"\n ],\n \"api/runtime\": [\n \"./dist/api/runtime.d.ts\"\n ],\n \"request\": [\n \"./dist/request.d.ts\"\n ],\n \"client\": [\n \"./types/client.d.ts\",\n \"./dist/client.d.ts\"\n ],\n \"client/lifecycle\": [\n \"./dist/client/lifecycle.d.ts\"\n ],\n \"server\": [\n \"./dist/server.d.ts\"\n ],\n \"vite\": [\n \"./dist/vite.d.ts\"\n ],\n \"plugin\": [\n \"./dist/plugin.d.ts\"\n ],\n \"query\": [\n \"./dist/query/index.d.ts\"\n ],\n \"*\": [\n \"./dist/*.d.ts\"\n ]\n }\n },\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.mjs\",\n \"require\": \"./dist/index.cjs\",\n \"default\": \"./dist/index.mjs\"\n },\n \"./version\": {\n \"types\": \"./dist/version.d.ts\",\n \"import\": \"./dist/version.mjs\",\n \"require\": \"./dist/version.cjs\"\n },\n \"./config\": {\n \"types\": \"./dist/config.d.ts\",\n \"import\": \"./dist/config.mjs\",\n \"require\": \"./dist/config.cjs\"\n },\n \"./renderer\": {\n \"types\": \"./dist/renderer.d.ts\",\n \"import\": \"./dist/renderer.mjs\",\n \"require\": \"./dist/renderer.cjs\"\n },\n \"./renderer-client\": {\n \"types\": \"./dist/renderer-client.d.ts\",\n \"import\": \"./dist/renderer-client.mjs\",\n \"require\": \"./dist/renderer-client.cjs\"\n },\n \"./renderer/react/server\": {\n \"types\": \"./dist/renderer/react/server.d.ts\",\n \"import\": \"./dist/renderer/react/server.mjs\",\n \"require\": \"./dist/renderer/react/server.cjs\"\n },\n \"./renderer/react/client\": {\n \"types\": \"./dist/renderer/react/client.d.ts\",\n \"import\": \"./dist/renderer/react/client.mjs\",\n \"require\": \"./dist/renderer/react/client.cjs\"\n },\n \"./renderer/react/vite\": {\n \"types\": \"./dist/renderer/react/vite.d.ts\",\n \"import\": \"./dist/renderer/react/vite.mjs\",\n \"require\": \"./dist/renderer/react/vite.cjs\"\n },\n \"./server\": {\n \"types\": \"./dist/server.d.ts\",\n \"import\": \"./dist/server.mjs\",\n \"require\": \"./dist/server.cjs\"\n },\n \"./client\": {\n \"types\": \"./types/client.d.ts\",\n \"import\": \"./dist/client.mjs\",\n \"require\": \"./dist/client.cjs\"\n },\n \"./client/lifecycle\": {\n \"types\": \"./dist/client/lifecycle.d.ts\",\n \"import\": \"./dist/client/lifecycle.mjs\",\n \"require\": \"./dist/client/lifecycle.cjs\"\n },\n \"./storage\": {\n \"types\": \"./dist/storage.d.ts\",\n \"import\": \"./dist/storage.mjs\",\n \"require\": \"./dist/storage.cjs\"\n },\n \"./integrations\": {\n \"types\": \"./dist/integrations.d.ts\",\n \"import\": \"./dist/integrations.mjs\",\n \"require\": \"./dist/integrations.cjs\"\n },\n \"./cache\": {\n \"types\": \"./dist/cache.d.ts\",\n \"import\": \"./dist/cache.mjs\",\n \"require\": \"./dist/cache.cjs\"\n },\n \"./deferred\": {\n \"types\": \"./dist/deferred.d.ts\",\n \"import\": \"./dist/deferred.mjs\",\n \"require\": \"./dist/deferred.cjs\"\n },\n \"./after\": {\n \"types\": \"./dist/after.d.ts\",\n \"import\": \"./dist/after.mjs\",\n \"require\": \"./dist/after.cjs\"\n },\n \"./navigation\": {\n \"types\": \"./dist/navigation.d.ts\",\n \"import\": \"./dist/navigation.mjs\",\n \"require\": \"./dist/navigation.cjs\"\n },\n \"./headers\": {\n \"types\": \"./dist/headers.d.ts\",\n \"import\": \"./dist/headers.mjs\",\n \"require\": \"./dist/headers.cjs\"\n },\n \"./theme\": {\n \"types\": \"./dist/theme/index.d.ts\",\n \"import\": \"./dist/theme/index.mjs\",\n \"require\": \"./dist/theme/index.cjs\"\n },\n \"./theme/client\": {\n \"types\": \"./dist/theme/client.d.ts\",\n \"import\": \"./dist/theme/client.mjs\",\n \"require\": \"./dist/theme/client.cjs\"\n },\n \"./theme/runtime\": {\n \"types\": \"./dist/theme/runtime.d.ts\",\n \"import\": \"./dist/theme/runtime.mjs\",\n \"require\": \"./dist/theme/runtime.cjs\"\n },\n \"./theme/server\": {\n \"types\": \"./dist/theme/server.d.ts\",\n \"import\": \"./dist/theme/server.mjs\",\n \"require\": \"./dist/theme/server.cjs\"\n },\n \"./docs\": {\n \"types\": \"./dist/docs.d.ts\",\n \"import\": \"./dist/docs.mjs\",\n \"require\": \"./dist/docs.cjs\"\n },\n \"./markdown\": {\n \"types\": \"./dist/markdown.d.ts\",\n \"import\": \"./dist/markdown.mjs\",\n \"require\": \"./dist/markdown.cjs\"\n },\n \"./app-markdown\": {\n \"types\": \"./dist/app-markdown.d.ts\",\n \"import\": \"./dist/app-markdown.mjs\",\n \"require\": \"./dist/app-markdown.cjs\"\n },\n \"./observability\": {\n \"types\": \"./dist/observability.d.ts\",\n \"import\": \"./dist/observability.mjs\",\n \"require\": \"./dist/observability.cjs\"\n },\n \"./instrumentation\": {\n \"types\": \"./dist/instrumentation.d.ts\",\n \"import\": \"./dist/instrumentation.mjs\",\n \"require\": \"./dist/instrumentation.cjs\"\n },\n \"./workflows\": {\n \"types\": \"./dist/workflows.d.ts\",\n \"import\": \"./dist/workflows.mjs\",\n \"require\": \"./dist/workflows.cjs\"\n },\n \"./cron\": {\n \"types\": \"./dist/cron.d.ts\",\n \"import\": \"./dist/cron.mjs\",\n \"require\": \"./dist/cron.cjs\"\n },\n \"./server-fn\": {\n \"types\": \"./dist/server-fn.d.ts\",\n \"import\": \"./dist/server-fn.mjs\",\n \"require\": \"./dist/server-fn.cjs\"\n },\n \"./server-fn/client\": {\n \"types\": \"./dist/server-fn-client.d.ts\",\n \"import\": \"./dist/server-fn-client.mjs\",\n \"require\": \"./dist/server-fn-client.cjs\"\n },\n \"./server-query\": {\n \"types\": \"./dist/server-query.d.ts\",\n \"import\": \"./dist/server-query.mjs\",\n \"require\": \"./dist/server-query.cjs\"\n },\n \"./server-query/client\": {\n \"types\": \"./dist/server-query-client.d.ts\",\n \"import\": \"./dist/server-query-client.mjs\",\n \"require\": \"./dist/server-query-client.cjs\"\n },\n \"./server-action-security\": {\n \"types\": \"./dist/server-action-security.d.ts\",\n \"import\": \"./dist/server-action-security.mjs\",\n \"require\": \"./dist/server-action-security.cjs\"\n },\n \"./deployment\": {\n \"types\": \"./dist/deployment.d.ts\",\n \"import\": \"./dist/deployment.mjs\",\n \"require\": \"./dist/deployment.cjs\"\n },\n \"./env\": {\n \"types\": \"./dist/env.d.ts\",\n \"import\": \"./dist/env.mjs\",\n \"require\": \"./dist/env.cjs\"\n },\n \"./env-types\": {\n \"types\": \"./dist/env-types.d.ts\",\n \"import\": \"./dist/env-types.mjs\",\n \"require\": \"./dist/env-types.cjs\"\n },\n \"./environment\": {\n \"types\": \"./dist/environment.d.ts\",\n \"import\": \"./dist/environment.mjs\",\n \"require\": \"./dist/environment.cjs\"\n },\n \"./environment/vite\": {\n \"types\": \"./dist/environment/vite.d.ts\",\n \"import\": \"./dist/environment/vite.mjs\",\n \"require\": \"./dist/environment/vite.cjs\"\n },\n \"./font\": {\n \"types\": \"./dist/font.d.ts\",\n \"import\": \"./dist/font.mjs\",\n \"require\": \"./dist/font.cjs\"\n },\n \"./vite\": {\n \"types\": \"./dist/vite.d.ts\",\n \"import\": \"./dist/vite.mjs\",\n \"require\": \"./dist/vite.cjs\"\n },\n \"./plugin\": {\n \"types\": \"./dist/plugin.d.ts\",\n \"import\": \"./dist/plugin.mjs\",\n \"require\": \"./dist/plugin.cjs\"\n },\n \"./plugin/server\": {\n \"types\": \"./dist/server-plugins.d.ts\",\n \"import\": \"./dist/server-plugins.mjs\",\n \"require\": \"./dist/server-plugins.cjs\"\n },\n \"./plugin/client\": {\n \"types\": \"./dist/client-plugins.d.ts\",\n \"import\": \"./dist/client-plugins.mjs\",\n \"require\": \"./dist/client-plugins.cjs\"\n },\n \"./query\": {\n \"types\": \"./dist/query/index.d.ts\",\n \"import\": \"./dist/query/index.mjs\",\n \"require\": \"./dist/query/index.cjs\"\n },\n \"./query/parsers\": {\n \"types\": \"./dist/query/parsers.d.ts\",\n \"import\": \"./dist/query/parsers.mjs\",\n \"require\": \"./dist/query/parsers.cjs\"\n },\n \"./query/client\": {\n \"types\": \"./dist/query/client.d.ts\",\n \"import\": \"./dist/query/client.mjs\",\n \"require\": \"./dist/query/client.cjs\"\n },\n \"./query/server\": {\n \"types\": \"./dist/query/server.d.ts\",\n \"import\": \"./dist/query/server.mjs\",\n \"require\": \"./dist/query/server.cjs\"\n },\n \"./middleware\": {\n \"types\": \"./dist/middleware.d.ts\",\n \"import\": \"./dist/middleware.mjs\",\n \"require\": \"./dist/middleware.cjs\"\n },\n \"./api\": {\n \"types\": \"./dist/api.d.ts\",\n \"import\": \"./dist/api.mjs\",\n \"require\": \"./dist/api.cjs\"\n },\n \"./api/route-manager\": {\n \"types\": \"./dist/api/route-manager.d.ts\",\n \"import\": \"./dist/api/route-manager.mjs\",\n \"require\": \"./dist/api/route-manager.cjs\"\n },\n \"./api/runtime\": {\n \"types\": \"./dist/api/runtime.d.ts\",\n \"import\": \"./dist/api/runtime.mjs\",\n \"require\": \"./dist/api/runtime.cjs\"\n },\n \"./request\": {\n \"types\": \"./dist/request.d.ts\",\n \"import\": \"./dist/request.mjs\",\n \"require\": \"./dist/request.cjs\"\n },\n \"./router\": {\n \"types\": \"./dist/router.d.ts\",\n \"import\": \"./dist/router.mjs\",\n \"require\": \"./dist/router.cjs\"\n },\n \"./routes\": {\n \"types\": \"./dist/routes.d.ts\",\n \"import\": \"./dist/routes.mjs\",\n \"require\": \"./dist/routes.cjs\"\n },\n \"./testing\": {\n \"types\": \"./dist/testing.d.ts\",\n \"import\": \"./dist/testing.mjs\",\n \"require\": \"./dist/testing.cjs\"\n },\n \"./agent-runtime\": {\n \"types\": \"./dist/agent-runtime.d.ts\",\n \"import\": \"./dist/agent-runtime.mjs\",\n \"require\": \"./dist/agent-runtime.cjs\"\n },\n \"./css\": {\n \"types\": \"./types/css.d.ts\"\n },\n \"./image\": {\n \"types\": \"./types/image.d.ts\",\n \"import\": \"./dist/image.mjs\",\n \"require\": \"./dist/image.cjs\"\n },\n \"./image/server\": {\n \"types\": \"./dist/image/server.d.ts\",\n \"import\": \"./dist/image/server.mjs\",\n \"require\": \"./dist/image/server.cjs\"\n },\n \"./image/sharp\": {\n \"types\": \"./dist/image/sharp.d.ts\",\n \"import\": \"./dist/image/sharp.mjs\",\n \"require\": \"./dist/image/sharp.cjs\"\n },\n \"./i18n\": {\n \"types\": \"./dist/i18n/index.d.ts\",\n \"import\": \"./dist/i18n/index.mjs\",\n \"require\": \"./dist/i18n/index.cjs\"\n },\n \"./i18n/server\": {\n \"types\": \"./dist/i18n/server.d.ts\",\n \"import\": \"./dist/i18n/server.mjs\",\n \"require\": \"./dist/i18n/server.cjs\"\n },\n \"./i18n/client\": {\n \"types\": \"./dist/i18n/client.d.ts\",\n \"import\": \"./dist/i18n/client.mjs\",\n \"require\": \"./dist/i18n/client.cjs\"\n },\n \"./internal/production-runtime\": {\n \"types\": \"./dist/internal/production-runtime.d.ts\",\n \"import\": \"./dist/internal/production-runtime.mjs\",\n \"require\": \"./dist/internal/production-runtime.cjs\"\n },\n \"./internal/metadata-image-runtime\": {\n \"types\": \"./dist/internal/metadata-image-runtime.d.ts\",\n \"import\": \"./dist/internal/metadata-image-runtime.mjs\",\n \"require\": \"./dist/internal/metadata-image-runtime.cjs\"\n },\n \"./internal/client-runtime\": {\n \"types\": \"./dist/internal/client-runtime.d.ts\",\n \"import\": \"./dist/internal/client-runtime.mjs\",\n \"require\": \"./dist/internal/client-runtime.cjs\"\n },\n \"./internal/build-runtime\": {\n \"types\": \"./dist/internal/build-runtime.d.ts\",\n \"import\": \"./dist/internal/build-runtime.mjs\",\n \"require\": \"./dist/internal/build-runtime.cjs\"\n },\n \"./internal/config-runtime\": {\n \"types\": \"./dist/internal/config-runtime.d.ts\",\n \"import\": \"./dist/internal/config-runtime.mjs\",\n \"require\": \"./dist/internal/config-runtime.cjs\"\n },\n \"./internal/production-node-env\": {\n \"types\": \"./dist/internal/production-node-env.d.ts\",\n \"import\": \"./dist/internal/production-node-env.mjs\",\n \"require\": \"./dist/internal/production-node-env.cjs\"\n }\n },\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"scripts\": {\n \"build\": \"tsup\",\n \"build:runtime\": \"tsup --config tsup.runtime.config.ts\",\n \"dev\": \"tsup --watch\",\n \"test\": \"vitest run\",\n \"test:coverage\": \"vitest --coverage\",\n \"lint\": \"biome lint .\",\n \"lint:fix\": \"biome lint --write .\",\n \"format\": \"biome format --write .\",\n \"type-check\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\"\n },\n \"dependencies\": {\n \"@farming-labs/docs\": \"^0.2.44\",\n \"@farming-labs/orm\": \"0.0.62\",\n \"@farming-labs/orm-runtime\": \"0.0.62\",\n \"@formatjs/icu-messageformat-parser\": \"3.5.15\",\n \"@jridgewell/trace-mapping\": \"0.3.31\",\n \"@mdx-js/mdx\": \"^3.1.1\",\n \"@opentelemetry/api\": \"1.9.1\",\n \"@scalar/api-reference\": \"^1.38.1\",\n \"@scalar/openapi-parser\": \"^0.22.3\",\n \"@tailwindcss/vite\": \"4.1.18\",\n \"@vercel/og\": \"0.11.1\",\n \"@vitejs/plugin-react\": \"^4.2.1\",\n \"better-call\": \"^1.0.19\",\n \"db0\": \"^0.3.4\",\n \"esbuild\": \"^0.28.0\",\n \"fast-glob\": \"^3.3.2\",\n \"h3\": \"2.0.1-rc.5\",\n \"image-size\": \"^2.0.2\",\n \"intl-messageformat\": \"11.2.12\",\n \"marked\": \"^12.0.2\",\n \"nitro\": \"3.0.1-alpha.0\",\n \"pg\": \"^8.20.0\",\n \"picocolors\": \"^1.0.0\",\n \"remark-gfm\": \"^4.0.1\",\n \"sirv\": \"^2.0.4\",\n \"sugar-high\": \"^0.9.5\",\n \"supports-color\": \"^10.2.2\",\n \"tailwindcss\": \"4.1.18\",\n \"unstorage\": \"^2.0.0-alpha.3\",\n \"vite\": \"^5.0.10\",\n \"zod\": \"^4.1.12\"\n },\n \"devDependencies\": {\n \"@clerk/react\": \"^6.1.0\",\n \"@farm.js/otel\": \"workspace:*\",\n \"@farm.js/renderer-tests\": \"workspace:*\",\n \"@opentelemetry/sdk-node\": \"0.221.0\",\n \"@opentelemetry/sdk-trace-base\": \"2.10.0\",\n \"@types/react\": \"^18.2.45\",\n \"@types/react-dom\": \"^18.2.18\",\n \"@vitest/coverage-v8\": \"^1.1.0\",\n \"jsdom\": \"^25.0.0\",\n \"react\": \"19.2.8\",\n \"react-dom\": \"19.2.8\",\n \"tsup\": \"^8.3.5\",\n \"typescript\": \"^5.3.3\",\n \"vitest\": \"^1.1.0\"\n },\n \"peerDependencies\": {\n \"react\": \"^18.2.0 || ^19.0.0\",\n \"react-dom\": \"^18.2.0 || ^19.0.0\"\n },\n \"peerDependenciesMeta\": {\n \"react\": {\n \"optional\": true\n },\n \"react-dom\": {\n \"optional\": true\n }\n },\n \"optionalDependencies\": {\n \"rolldown\": \"1.2.0\",\n \"sharp\": \"^0.34.5\",\n \"vite-rolldown\": \"npm:vite@8.1.5\"\n }\n}\n","import { version } from \"../package.json\";\n\nexport const FARM_VERSION = version;\n"],"mappings":";AAEE,cAAW;;;ACAN,IAAM,eAAe;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../package.json","../src/version.ts"],"sourcesContent":["{\n \"name\": \"@farm.js/core\",\n \"version\": \"0.1.0-beta.55\",\n \"description\": \"Core Farm.js framework for modern integrated apps\",\n \"keywords\": [\n \"@farm.js/core\",\n \"framework\",\n \"react\",\n \"rsc\",\n \"server-components\",\n \"ssr\",\n \"vite\"\n ],\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/farming-labs/farm.js\",\n \"directory\": \"packages/farm\"\n },\n \"files\": [\n \"dist\",\n \"types\"\n ],\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"typesVersions\": {\n \"*\": {\n \"middleware\": [\n \"./types/middleware.d.ts\",\n \"./dist/middleware.d.ts\"\n ],\n \"version\": [\n \"./dist/version.d.ts\"\n ],\n \"router\": [\n \"./dist/router.d.ts\"\n ],\n \"routes\": [\n \"./dist/routes.d.ts\"\n ],\n \"storage\": [\n \"./dist/storage.d.ts\"\n ],\n \"integrations\": [\n \"./dist/integrations.d.ts\"\n ],\n \"cache\": [\n \"./dist/cache.d.ts\"\n ],\n \"deferred\": [\n \"./dist/deferred.d.ts\"\n ],\n \"after\": [\n \"./dist/after.d.ts\"\n ],\n \"navigation\": [\n \"./dist/navigation.d.ts\"\n ],\n \"headers\": [\n \"./dist/headers.d.ts\"\n ],\n \"theme\": [\n \"./dist/theme/index.d.ts\"\n ],\n \"theme/client\": [\n \"./dist/theme/client.d.ts\"\n ],\n \"theme/runtime\": [\n \"./dist/theme/runtime.d.ts\"\n ],\n \"theme/server\": [\n \"./dist/theme/server.d.ts\"\n ],\n \"docs\": [\n \"./dist/docs.d.ts\"\n ],\n \"markdown\": [\n \"./dist/markdown.d.ts\"\n ],\n \"app-markdown\": [\n \"./dist/app-markdown.d.ts\"\n ],\n \"observability\": [\n \"./dist/observability.d.ts\"\n ],\n \"instrumentation\": [\n \"./dist/instrumentation.d.ts\"\n ],\n \"workflows\": [\n \"./dist/workflows.d.ts\"\n ],\n \"cron\": [\n \"./dist/cron.d.ts\"\n ],\n \"server-fn\": [\n \"./dist/server-fn.d.ts\"\n ],\n \"server-fn/client\": [\n \"./dist/server-fn-client.d.ts\"\n ],\n \"server-query\": [\n \"./dist/server-query.d.ts\"\n ],\n \"server-query/client\": [\n \"./dist/server-query-client.d.ts\"\n ],\n \"server-action-security\": [\n \"./dist/server-action-security.d.ts\"\n ],\n \"deployment\": [\n \"./dist/deployment.d.ts\"\n ],\n \"env\": [\n \"./dist/env.d.ts\"\n ],\n \"env-types\": [\n \"./dist/env-types.d.ts\"\n ],\n \"environment\": [\n \"./dist/environment.d.ts\"\n ],\n \"environment/vite\": [\n \"./dist/environment/vite.d.ts\"\n ],\n \"font\": [\n \"./dist/font.d.ts\"\n ],\n \"testing\": [\n \"./dist/testing.d.ts\"\n ],\n \"agent-runtime\": [\n \"./dist/agent-runtime.d.ts\"\n ],\n \"css\": [\n \"./types/css.d.ts\"\n ],\n \"image\": [\n \"./types/image.d.ts\",\n \"./dist/image.d.ts\"\n ],\n \"image/server\": [\n \"./dist/image/server.d.ts\"\n ],\n \"image/sharp\": [\n \"./dist/image/sharp.d.ts\"\n ],\n \"i18n\": [\n \"./dist/i18n/index.d.ts\"\n ],\n \"i18n/server\": [\n \"./dist/i18n/server.d.ts\"\n ],\n \"i18n/client\": [\n \"./dist/i18n/client.d.ts\"\n ],\n \"internal/production-runtime\": [\n \"./dist/internal/production-runtime.d.ts\"\n ],\n \"internal/metadata-image-runtime\": [\n \"./dist/internal/metadata-image-runtime.d.ts\"\n ],\n \"internal/client-runtime\": [\n \"./dist/internal/client-runtime.d.ts\"\n ],\n \"internal/build-runtime\": [\n \"./dist/internal/build-runtime.d.ts\"\n ],\n \"internal/config-runtime\": [\n \"./dist/internal/config-runtime.d.ts\"\n ],\n \"internal/production-node-env\": [\n \"./dist/internal/production-node-env.d.ts\"\n ],\n \"config\": [\n \"./dist/config.d.ts\"\n ],\n \"renderer\": [\n \"./dist/renderer.d.ts\"\n ],\n \"renderer-client\": [\n \"./dist/renderer-client.d.ts\"\n ],\n \"api\": [\n \"./types/api.d.ts\",\n \"./dist/api.d.ts\"\n ],\n \"api/route-manager\": [\n \"./dist/api/route-manager.d.ts\"\n ],\n \"api/runtime\": [\n \"./dist/api/runtime.d.ts\"\n ],\n \"request\": [\n \"./dist/request.d.ts\"\n ],\n \"client\": [\n \"./types/client.d.ts\",\n \"./dist/client.d.ts\"\n ],\n \"client/lifecycle\": [\n \"./dist/client/lifecycle.d.ts\"\n ],\n \"server\": [\n \"./dist/server.d.ts\"\n ],\n \"vite\": [\n \"./dist/vite.d.ts\"\n ],\n \"plugin\": [\n \"./dist/plugin.d.ts\"\n ],\n \"query\": [\n \"./dist/query/index.d.ts\"\n ],\n \"*\": [\n \"./dist/*.d.ts\"\n ]\n }\n },\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.mjs\",\n \"require\": \"./dist/index.cjs\",\n \"default\": \"./dist/index.mjs\"\n },\n \"./version\": {\n \"types\": \"./dist/version.d.ts\",\n \"import\": \"./dist/version.mjs\",\n \"require\": \"./dist/version.cjs\"\n },\n \"./config\": {\n \"types\": \"./dist/config.d.ts\",\n \"import\": \"./dist/config.mjs\",\n \"require\": \"./dist/config.cjs\"\n },\n \"./renderer\": {\n \"types\": \"./dist/renderer.d.ts\",\n \"import\": \"./dist/renderer.mjs\",\n \"require\": \"./dist/renderer.cjs\"\n },\n \"./renderer-client\": {\n \"types\": \"./dist/renderer-client.d.ts\",\n \"import\": \"./dist/renderer-client.mjs\",\n \"require\": \"./dist/renderer-client.cjs\"\n },\n \"./renderer/react/server\": {\n \"types\": \"./dist/renderer/react/server.d.ts\",\n \"import\": \"./dist/renderer/react/server.mjs\",\n \"require\": \"./dist/renderer/react/server.cjs\"\n },\n \"./renderer/react/client\": {\n \"types\": \"./dist/renderer/react/client.d.ts\",\n \"import\": \"./dist/renderer/react/client.mjs\",\n \"require\": \"./dist/renderer/react/client.cjs\"\n },\n \"./renderer/react/vite\": {\n \"types\": \"./dist/renderer/react/vite.d.ts\",\n \"import\": \"./dist/renderer/react/vite.mjs\",\n \"require\": \"./dist/renderer/react/vite.cjs\"\n },\n \"./server\": {\n \"types\": \"./dist/server.d.ts\",\n \"import\": \"./dist/server.mjs\",\n \"require\": \"./dist/server.cjs\"\n },\n \"./client\": {\n \"types\": \"./types/client.d.ts\",\n \"import\": \"./dist/client.mjs\",\n \"require\": \"./dist/client.cjs\"\n },\n \"./client/lifecycle\": {\n \"types\": \"./dist/client/lifecycle.d.ts\",\n \"import\": \"./dist/client/lifecycle.mjs\",\n \"require\": \"./dist/client/lifecycle.cjs\"\n },\n \"./storage\": {\n \"types\": \"./dist/storage.d.ts\",\n \"import\": \"./dist/storage.mjs\",\n \"require\": \"./dist/storage.cjs\"\n },\n \"./integrations\": {\n \"types\": \"./dist/integrations.d.ts\",\n \"import\": \"./dist/integrations.mjs\",\n \"require\": \"./dist/integrations.cjs\"\n },\n \"./cache\": {\n \"types\": \"./dist/cache.d.ts\",\n \"import\": \"./dist/cache.mjs\",\n \"require\": \"./dist/cache.cjs\"\n },\n \"./deferred\": {\n \"types\": \"./dist/deferred.d.ts\",\n \"import\": \"./dist/deferred.mjs\",\n \"require\": \"./dist/deferred.cjs\"\n },\n \"./after\": {\n \"types\": \"./dist/after.d.ts\",\n \"import\": \"./dist/after.mjs\",\n \"require\": \"./dist/after.cjs\"\n },\n \"./navigation\": {\n \"types\": \"./dist/navigation.d.ts\",\n \"import\": \"./dist/navigation.mjs\",\n \"require\": \"./dist/navigation.cjs\"\n },\n \"./headers\": {\n \"types\": \"./dist/headers.d.ts\",\n \"import\": \"./dist/headers.mjs\",\n \"require\": \"./dist/headers.cjs\"\n },\n \"./theme\": {\n \"types\": \"./dist/theme/index.d.ts\",\n \"import\": \"./dist/theme/index.mjs\",\n \"require\": \"./dist/theme/index.cjs\"\n },\n \"./theme/client\": {\n \"types\": \"./dist/theme/client.d.ts\",\n \"import\": \"./dist/theme/client.mjs\",\n \"require\": \"./dist/theme/client.cjs\"\n },\n \"./theme/runtime\": {\n \"types\": \"./dist/theme/runtime.d.ts\",\n \"import\": \"./dist/theme/runtime.mjs\",\n \"require\": \"./dist/theme/runtime.cjs\"\n },\n \"./theme/server\": {\n \"types\": \"./dist/theme/server.d.ts\",\n \"import\": \"./dist/theme/server.mjs\",\n \"require\": \"./dist/theme/server.cjs\"\n },\n \"./docs\": {\n \"types\": \"./dist/docs.d.ts\",\n \"import\": \"./dist/docs.mjs\",\n \"require\": \"./dist/docs.cjs\"\n },\n \"./markdown\": {\n \"types\": \"./dist/markdown.d.ts\",\n \"import\": \"./dist/markdown.mjs\",\n \"require\": \"./dist/markdown.cjs\"\n },\n \"./app-markdown\": {\n \"types\": \"./dist/app-markdown.d.ts\",\n \"import\": \"./dist/app-markdown.mjs\",\n \"require\": \"./dist/app-markdown.cjs\"\n },\n \"./observability\": {\n \"types\": \"./dist/observability.d.ts\",\n \"import\": \"./dist/observability.mjs\",\n \"require\": \"./dist/observability.cjs\"\n },\n \"./instrumentation\": {\n \"types\": \"./dist/instrumentation.d.ts\",\n \"import\": \"./dist/instrumentation.mjs\",\n \"require\": \"./dist/instrumentation.cjs\"\n },\n \"./workflows\": {\n \"types\": \"./dist/workflows.d.ts\",\n \"import\": \"./dist/workflows.mjs\",\n \"require\": \"./dist/workflows.cjs\"\n },\n \"./cron\": {\n \"types\": \"./dist/cron.d.ts\",\n \"import\": \"./dist/cron.mjs\",\n \"require\": \"./dist/cron.cjs\"\n },\n \"./server-fn\": {\n \"types\": \"./dist/server-fn.d.ts\",\n \"import\": \"./dist/server-fn.mjs\",\n \"require\": \"./dist/server-fn.cjs\"\n },\n \"./server-fn/client\": {\n \"types\": \"./dist/server-fn-client.d.ts\",\n \"import\": \"./dist/server-fn-client.mjs\",\n \"require\": \"./dist/server-fn-client.cjs\"\n },\n \"./server-query\": {\n \"types\": \"./dist/server-query.d.ts\",\n \"import\": \"./dist/server-query.mjs\",\n \"require\": \"./dist/server-query.cjs\"\n },\n \"./server-query/client\": {\n \"types\": \"./dist/server-query-client.d.ts\",\n \"import\": \"./dist/server-query-client.mjs\",\n \"require\": \"./dist/server-query-client.cjs\"\n },\n \"./server-action-security\": {\n \"types\": \"./dist/server-action-security.d.ts\",\n \"import\": \"./dist/server-action-security.mjs\",\n \"require\": \"./dist/server-action-security.cjs\"\n },\n \"./deployment\": {\n \"types\": \"./dist/deployment.d.ts\",\n \"import\": \"./dist/deployment.mjs\",\n \"require\": \"./dist/deployment.cjs\"\n },\n \"./env\": {\n \"types\": \"./dist/env.d.ts\",\n \"import\": \"./dist/env.mjs\",\n \"require\": \"./dist/env.cjs\"\n },\n \"./env-types\": {\n \"types\": \"./dist/env-types.d.ts\",\n \"import\": \"./dist/env-types.mjs\",\n \"require\": \"./dist/env-types.cjs\"\n },\n \"./environment\": {\n \"types\": \"./dist/environment.d.ts\",\n \"import\": \"./dist/environment.mjs\",\n \"require\": \"./dist/environment.cjs\"\n },\n \"./environment/vite\": {\n \"types\": \"./dist/environment/vite.d.ts\",\n \"import\": \"./dist/environment/vite.mjs\",\n \"require\": \"./dist/environment/vite.cjs\"\n },\n \"./font\": {\n \"types\": \"./dist/font.d.ts\",\n \"import\": \"./dist/font.mjs\",\n \"require\": \"./dist/font.cjs\"\n },\n \"./vite\": {\n \"types\": \"./dist/vite.d.ts\",\n \"import\": \"./dist/vite.mjs\",\n \"require\": \"./dist/vite.cjs\"\n },\n \"./plugin\": {\n \"types\": \"./dist/plugin.d.ts\",\n \"import\": \"./dist/plugin.mjs\",\n \"require\": \"./dist/plugin.cjs\"\n },\n \"./plugin/server\": {\n \"types\": \"./dist/server-plugins.d.ts\",\n \"import\": \"./dist/server-plugins.mjs\",\n \"require\": \"./dist/server-plugins.cjs\"\n },\n \"./plugin/client\": {\n \"types\": \"./dist/client-plugins.d.ts\",\n \"import\": \"./dist/client-plugins.mjs\",\n \"require\": \"./dist/client-plugins.cjs\"\n },\n \"./query\": {\n \"types\": \"./dist/query/index.d.ts\",\n \"import\": \"./dist/query/index.mjs\",\n \"require\": \"./dist/query/index.cjs\"\n },\n \"./query/parsers\": {\n \"types\": \"./dist/query/parsers.d.ts\",\n \"import\": \"./dist/query/parsers.mjs\",\n \"require\": \"./dist/query/parsers.cjs\"\n },\n \"./query/client\": {\n \"types\": \"./dist/query/client.d.ts\",\n \"import\": \"./dist/query/client.mjs\",\n \"require\": \"./dist/query/client.cjs\"\n },\n \"./query/server\": {\n \"types\": \"./dist/query/server.d.ts\",\n \"import\": \"./dist/query/server.mjs\",\n \"require\": \"./dist/query/server.cjs\"\n },\n \"./middleware\": {\n \"types\": \"./dist/middleware.d.ts\",\n \"import\": \"./dist/middleware.mjs\",\n \"require\": \"./dist/middleware.cjs\"\n },\n \"./api\": {\n \"types\": \"./dist/api.d.ts\",\n \"import\": \"./dist/api.mjs\",\n \"require\": \"./dist/api.cjs\"\n },\n \"./api/route-manager\": {\n \"types\": \"./dist/api/route-manager.d.ts\",\n \"import\": \"./dist/api/route-manager.mjs\",\n \"require\": \"./dist/api/route-manager.cjs\"\n },\n \"./api/runtime\": {\n \"types\": \"./dist/api/runtime.d.ts\",\n \"import\": \"./dist/api/runtime.mjs\",\n \"require\": \"./dist/api/runtime.cjs\"\n },\n \"./request\": {\n \"types\": \"./dist/request.d.ts\",\n \"import\": \"./dist/request.mjs\",\n \"require\": \"./dist/request.cjs\"\n },\n \"./router\": {\n \"types\": \"./dist/router.d.ts\",\n \"import\": \"./dist/router.mjs\",\n \"require\": \"./dist/router.cjs\"\n },\n \"./routes\": {\n \"types\": \"./dist/routes.d.ts\",\n \"import\": \"./dist/routes.mjs\",\n \"require\": \"./dist/routes.cjs\"\n },\n \"./testing\": {\n \"types\": \"./dist/testing.d.ts\",\n \"import\": \"./dist/testing.mjs\",\n \"require\": \"./dist/testing.cjs\"\n },\n \"./agent-runtime\": {\n \"types\": \"./dist/agent-runtime.d.ts\",\n \"import\": \"./dist/agent-runtime.mjs\",\n \"require\": \"./dist/agent-runtime.cjs\"\n },\n \"./css\": {\n \"types\": \"./types/css.d.ts\"\n },\n \"./image\": {\n \"types\": \"./types/image.d.ts\",\n \"import\": \"./dist/image.mjs\",\n \"require\": \"./dist/image.cjs\"\n },\n \"./image/server\": {\n \"types\": \"./dist/image/server.d.ts\",\n \"import\": \"./dist/image/server.mjs\",\n \"require\": \"./dist/image/server.cjs\"\n },\n \"./image/sharp\": {\n \"types\": \"./dist/image/sharp.d.ts\",\n \"import\": \"./dist/image/sharp.mjs\",\n \"require\": \"./dist/image/sharp.cjs\"\n },\n \"./i18n\": {\n \"types\": \"./dist/i18n/index.d.ts\",\n \"import\": \"./dist/i18n/index.mjs\",\n \"require\": \"./dist/i18n/index.cjs\"\n },\n \"./i18n/server\": {\n \"types\": \"./dist/i18n/server.d.ts\",\n \"import\": \"./dist/i18n/server.mjs\",\n \"require\": \"./dist/i18n/server.cjs\"\n },\n \"./i18n/client\": {\n \"types\": \"./dist/i18n/client.d.ts\",\n \"import\": \"./dist/i18n/client.mjs\",\n \"require\": \"./dist/i18n/client.cjs\"\n },\n \"./internal/production-runtime\": {\n \"types\": \"./dist/internal/production-runtime.d.ts\",\n \"import\": \"./dist/internal/production-runtime.mjs\",\n \"require\": \"./dist/internal/production-runtime.cjs\"\n },\n \"./internal/metadata-image-runtime\": {\n \"types\": \"./dist/internal/metadata-image-runtime.d.ts\",\n \"import\": \"./dist/internal/metadata-image-runtime.mjs\",\n \"require\": \"./dist/internal/metadata-image-runtime.cjs\"\n },\n \"./internal/client-runtime\": {\n \"types\": \"./dist/internal/client-runtime.d.ts\",\n \"import\": \"./dist/internal/client-runtime.mjs\",\n \"require\": \"./dist/internal/client-runtime.cjs\"\n },\n \"./internal/build-runtime\": {\n \"types\": \"./dist/internal/build-runtime.d.ts\",\n \"import\": \"./dist/internal/build-runtime.mjs\",\n \"require\": \"./dist/internal/build-runtime.cjs\"\n },\n \"./internal/config-runtime\": {\n \"types\": \"./dist/internal/config-runtime.d.ts\",\n \"import\": \"./dist/internal/config-runtime.mjs\",\n \"require\": \"./dist/internal/config-runtime.cjs\"\n },\n \"./internal/production-node-env\": {\n \"types\": \"./dist/internal/production-node-env.d.ts\",\n \"import\": \"./dist/internal/production-node-env.mjs\",\n \"require\": \"./dist/internal/production-node-env.cjs\"\n }\n },\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"scripts\": {\n \"build\": \"tsup\",\n \"build:runtime\": \"tsup --config tsup.runtime.config.ts\",\n \"dev\": \"tsup --watch\",\n \"test\": \"vitest run\",\n \"test:coverage\": \"vitest --coverage\",\n \"lint\": \"biome lint .\",\n \"lint:fix\": \"biome lint --write .\",\n \"format\": \"biome format --write .\",\n \"type-check\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\"\n },\n \"dependencies\": {\n \"@farming-labs/docs\": \"^0.2.44\",\n \"@farming-labs/orm\": \"0.0.62\",\n \"@farming-labs/orm-runtime\": \"0.0.62\",\n \"@formatjs/icu-messageformat-parser\": \"3.5.15\",\n \"@jridgewell/trace-mapping\": \"0.3.31\",\n \"@mdx-js/mdx\": \"^3.1.1\",\n \"@opentelemetry/api\": \"1.9.1\",\n \"@scalar/api-reference\": \"^1.38.1\",\n \"@scalar/openapi-parser\": \"^0.22.3\",\n \"@tailwindcss/vite\": \"4.1.18\",\n \"@vercel/og\": \"0.11.1\",\n \"@vitejs/plugin-react\": \"^4.2.1\",\n \"better-call\": \"^1.0.19\",\n \"db0\": \"^0.3.4\",\n \"esbuild\": \"^0.28.0\",\n \"fast-glob\": \"^3.3.2\",\n \"h3\": \"2.0.1-rc.5\",\n \"image-size\": \"^2.0.2\",\n \"intl-messageformat\": \"11.2.12\",\n \"marked\": \"^12.0.2\",\n \"nitro\": \"3.0.1-alpha.0\",\n \"pg\": \"^8.20.0\",\n \"picocolors\": \"^1.0.0\",\n \"remark-gfm\": \"^4.0.1\",\n \"sirv\": \"^2.0.4\",\n \"sugar-high\": \"^0.9.5\",\n \"supports-color\": \"^10.2.2\",\n \"tailwindcss\": \"4.1.18\",\n \"unstorage\": \"^2.0.0-alpha.3\",\n \"vite\": \"^5.0.10\",\n \"zod\": \"^4.1.12\"\n },\n \"devDependencies\": {\n \"@clerk/react\": \"^6.1.0\",\n \"@farm.js/otel\": \"workspace:*\",\n \"@farm.js/renderer-tests\": \"workspace:*\",\n \"@opentelemetry/sdk-node\": \"0.221.0\",\n \"@opentelemetry/sdk-trace-base\": \"2.10.0\",\n \"@types/react\": \"^18.2.45\",\n \"@types/react-dom\": \"^18.2.18\",\n \"@vitest/coverage-v8\": \"^1.1.0\",\n \"jsdom\": \"^25.0.0\",\n \"react\": \"19.2.8\",\n \"react-dom\": \"19.2.8\",\n \"tsup\": \"^8.3.5\",\n \"typescript\": \"^5.3.3\",\n \"vitest\": \"^1.1.0\"\n },\n \"peerDependencies\": {\n \"react\": \"^18.2.0 || ^19.0.0\",\n \"react-dom\": \"^18.2.0 || ^19.0.0\"\n },\n \"peerDependenciesMeta\": {\n \"react\": {\n \"optional\": true\n },\n \"react-dom\": {\n \"optional\": true\n }\n },\n \"optionalDependencies\": {\n \"rolldown\": \"1.2.0\",\n \"sharp\": \"^0.34.5\",\n \"vite-rolldown\": \"npm:vite@8.1.5\"\n }\n}\n","import { version } from \"../package.json\";\n\nexport const FARM_VERSION = version;\n"],"mappings":";AAEE,cAAW;;;ACAN,IAAM,eAAe;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-FXG2PS27.mjs";
|
|
4
4
|
import {
|
|
5
5
|
FARM_VERSION
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BLTATPSB.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__name
|
|
9
9
|
} from "./chunk-CGILA3WO.mjs";
|
|
@@ -1476,4 +1476,4 @@ export {
|
|
|
1476
1476
|
FarmClientPluginManager,
|
|
1477
1477
|
createClientPluginManager
|
|
1478
1478
|
};
|
|
1479
|
-
//# sourceMappingURL=chunk-
|
|
1479
|
+
//# sourceMappingURL=chunk-MSQDIAQW.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useRouter
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZP5IWDTE.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__name
|
|
6
6
|
} from "./chunk-CGILA3WO.mjs";
|
|
@@ -38,4 +38,4 @@ export {
|
|
|
38
38
|
usePathname,
|
|
39
39
|
useSearchParams
|
|
40
40
|
};
|
|
41
|
-
//# sourceMappingURL=chunk-
|
|
41
|
+
//# sourceMappingURL=chunk-OGFWHBDO.mjs.map
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
getAPIRouteRefMetadata,
|
|
3
3
|
isAPIRouteRef
|
|
4
4
|
} from "./chunk-T2YM7NCW.mjs";
|
|
5
|
+
import {
|
|
6
|
+
buildFarmRoutePath
|
|
7
|
+
} from "./chunk-ZBE6MLHL.mjs";
|
|
5
8
|
import {
|
|
6
9
|
isFarmLocaleChangeHref,
|
|
7
10
|
localizeActiveFarmHref
|
|
8
11
|
} from "./chunk-ITN462YM.mjs";
|
|
9
|
-
import {
|
|
10
|
-
buildFarmRoutePath
|
|
11
|
-
} from "./chunk-ZBE6MLHL.mjs";
|
|
12
12
|
import {
|
|
13
13
|
__name
|
|
14
14
|
} from "./chunk-CGILA3WO.mjs";
|
|
@@ -869,4 +869,4 @@ export {
|
|
|
869
869
|
createStore,
|
|
870
870
|
Link
|
|
871
871
|
};
|
|
872
|
-
//# sourceMappingURL=chunk-
|
|
872
|
+
//# sourceMappingURL=chunk-PYIVNTDI.mjs.map
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
mergeFarmFontCss,
|
|
38
38
|
mergeFarmViteConfig,
|
|
39
39
|
resolveRouteRenderingConfigFromFile
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-2ISN27CV.mjs";
|
|
41
41
|
import {
|
|
42
42
|
farmEnvironmentFunctionsPlugin
|
|
43
43
|
} from "./chunk-V6WE6JSZ.mjs";
|
|
@@ -7719,4 +7719,4 @@ __name(buildNitro, "buildNitro");
|
|
|
7719
7719
|
export {
|
|
7720
7720
|
build
|
|
7721
7721
|
};
|
|
7722
|
-
//# sourceMappingURL=chunk-
|
|
7722
|
+
//# sourceMappingURL=chunk-RAZ7L3UY.mjs.map
|
|
@@ -43,6 +43,16 @@ var _SPARouter = class _SPARouter {
|
|
|
43
43
|
this.navigationListeners = /* @__PURE__ */ new Set();
|
|
44
44
|
this.navigationState = IDLE_NAVIGATION_STATE;
|
|
45
45
|
this.scrollElements = /* @__PURE__ */ new Map();
|
|
46
|
+
this.onPopState = /* @__PURE__ */ __name((event) => {
|
|
47
|
+
void this.handlePopState(event);
|
|
48
|
+
}, "onPopState");
|
|
49
|
+
this.onBeforeUnload = /* @__PURE__ */ __name((event) => {
|
|
50
|
+
if (this.blockers.size > 0) {
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
event.returnValue = "";
|
|
53
|
+
}
|
|
54
|
+
this.saveScrollPosition(window.location.pathname);
|
|
55
|
+
}, "onBeforeUnload");
|
|
46
56
|
this.options = {
|
|
47
57
|
prefetchTimeout: options.prefetchTimeout ?? 100,
|
|
48
58
|
cacheMaxAge: options.cacheMaxAge ?? 3e4,
|
|
@@ -52,16 +62,16 @@ var _SPARouter = class _SPARouter {
|
|
|
52
62
|
deploymentId: options.deploymentId ?? readBrowserDeploymentId()
|
|
53
63
|
};
|
|
54
64
|
if (typeof window !== "undefined") {
|
|
55
|
-
window.addEventListener("popstate", this.
|
|
56
|
-
window.addEventListener("beforeunload",
|
|
57
|
-
if (this.blockers.size > 0) {
|
|
58
|
-
event.preventDefault();
|
|
59
|
-
event.returnValue = "";
|
|
60
|
-
}
|
|
61
|
-
this.saveScrollPosition(window.location.pathname);
|
|
62
|
-
});
|
|
65
|
+
window.addEventListener("popstate", this.onPopState);
|
|
66
|
+
window.addEventListener("beforeunload", this.onBeforeUnload);
|
|
63
67
|
}
|
|
64
68
|
}
|
|
69
|
+
/** Remove global listeners. Intended for tests and teardown. */
|
|
70
|
+
destroy() {
|
|
71
|
+
if (typeof window === "undefined") return;
|
|
72
|
+
window.removeEventListener("popstate", this.onPopState);
|
|
73
|
+
window.removeEventListener("beforeunload", this.onBeforeUnload);
|
|
74
|
+
}
|
|
65
75
|
/**
|
|
66
76
|
* Set the navigation handler that updates React
|
|
67
77
|
*/
|
|
@@ -524,11 +534,16 @@ function dispatchDeploymentMismatch(error) {
|
|
|
524
534
|
window.dispatchEvent(new CustomEvent("farm:deployment-mismatch", { detail: error }));
|
|
525
535
|
}
|
|
526
536
|
__name(dispatchDeploymentMismatch, "dispatchDeploymentMismatch");
|
|
537
|
+
function getInstalledFarmSPARouter() {
|
|
538
|
+
if (typeof window === "undefined") return void 0;
|
|
539
|
+
return window.__FARM_SPA_ROUTER__;
|
|
540
|
+
}
|
|
541
|
+
__name(getInstalledFarmSPARouter, "getInstalledFarmSPARouter");
|
|
527
542
|
function getRouter() {
|
|
528
543
|
if (typeof window === "undefined") {
|
|
529
544
|
return new SPARouter();
|
|
530
545
|
}
|
|
531
|
-
const installedRouter =
|
|
546
|
+
const installedRouter = getInstalledFarmSPARouter();
|
|
532
547
|
if (installedRouter) {
|
|
533
548
|
routerInstance = installedRouter;
|
|
534
549
|
return installedRouter;
|
|
@@ -596,6 +611,31 @@ function getScrollElementStorageKey(path, key) {
|
|
|
596
611
|
}
|
|
597
612
|
__name(getScrollElementStorageKey, "getScrollElementStorageKey");
|
|
598
613
|
|
|
614
|
+
// src/client/url-search-sync.ts
|
|
615
|
+
var FARM_URL_SEARCH_CHANGE_EVENT = "farm:urlsearchchange";
|
|
616
|
+
function notifyUrlSearchObservers(shallow) {
|
|
617
|
+
if (!shallow || typeof window === "undefined") return;
|
|
618
|
+
setTimeout(() => {
|
|
619
|
+
if (getInstalledFarmSPARouter()) {
|
|
620
|
+
window.dispatchEvent(new CustomEvent(FARM_URL_SEARCH_CHANGE_EVENT));
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
window.dispatchEvent(new PopStateEvent("popstate"));
|
|
624
|
+
}, 0);
|
|
625
|
+
}
|
|
626
|
+
__name(notifyUrlSearchObservers, "notifyUrlSearchObservers");
|
|
627
|
+
function subscribeUrlSearchObservers(listener) {
|
|
628
|
+
if (typeof window === "undefined") return () => {
|
|
629
|
+
};
|
|
630
|
+
window.addEventListener("popstate", listener);
|
|
631
|
+
window.addEventListener(FARM_URL_SEARCH_CHANGE_EVENT, listener);
|
|
632
|
+
return () => {
|
|
633
|
+
window.removeEventListener("popstate", listener);
|
|
634
|
+
window.removeEventListener(FARM_URL_SEARCH_CHANGE_EVENT, listener);
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
__name(subscribeUrlSearchObservers, "subscribeUrlSearchObservers");
|
|
638
|
+
|
|
599
639
|
export {
|
|
600
640
|
SPARouter,
|
|
601
641
|
getRouter,
|
|
@@ -603,6 +643,9 @@ export {
|
|
|
603
643
|
prefetch,
|
|
604
644
|
pushState,
|
|
605
645
|
replaceState,
|
|
606
|
-
readPageState
|
|
646
|
+
readPageState,
|
|
647
|
+
FARM_URL_SEARCH_CHANGE_EVENT,
|
|
648
|
+
notifyUrlSearchObservers,
|
|
649
|
+
subscribeUrlSearchObservers
|
|
607
650
|
};
|
|
608
|
-
//# sourceMappingURL=chunk-
|
|
651
|
+
//# sourceMappingURL=chunk-YBHLSG7E.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/client/spa-router.ts","../src/client/url-search-sync.ts"],"sourcesContent":["\"use client\";\n\nimport { readDeferredDataResponse } from \"../deferred\";\nimport {\n createFarmDeploymentMismatchError,\n createFarmDeploymentRequestHeaders,\n isFarmDeploymentMismatchResponse,\n} from \"../deployment\";\nimport type { FarmClientNavigationSession, FarmClientPluginManager } from \"./plugin\";\nimport { _hydrateFarmI18n, isFarmLocaleChangeHref } from \"../i18n/client-runtime\";\nimport type { FarmI18nClientSnapshot } from \"../i18n/types\";\nimport type { FarmIslandStrategy } from \"../island\";\nimport type { FarmRouteRenderPlan } from \"../navigation/render-plan\";\n\n/**\n * Farm.js SPA Router\n *\n * Provides client-side navigation without full page reloads.\n * Features:\n * - Prefetch on viewport intersection\n * - Prefetch on hover\n * - Page caching\n * - History API integration\n * - Scroll restoration\n */\n\ninterface PageData {\n props: Record<string, any>;\n modulePath: string;\n loadingModulePath?: string | null;\n canonicalPath?: string;\n isClientComponent?: boolean;\n shouldHydrate?: boolean;\n islandStrategy?: FarmIslandStrategy | null;\n renderPlan?: FarmRouteRenderPlan;\n fragment?: {\n html: string;\n layoutPatterns: string[];\n };\n metadata?: {\n title?: string;\n description?: string;\n };\n layoutModules?: string[];\n routeSlots?: RouteSlotPageData[];\n interception?: {\n from?: string;\n slots: string[];\n };\n i18n?: FarmI18nClientSnapshot;\n}\n\ninterface RouteSlotPageData {\n name: string;\n ownerPattern: string;\n containerId: string;\n interception: boolean;\n fallback: boolean;\n modulePath: string;\n isClientComponent: boolean;\n shouldHydrate: boolean;\n props: Record<string, any>;\n}\n\nexport interface RouterOptions {\n prefetchTimeout?: number;\n cacheMaxAge?: number;\n scrollRestoration?: boolean;\n shouldUseDocumentNavigation?: (pathname: string) => boolean;\n deploymentId?: string;\n}\n\ninterface CacheEntry {\n data: PageData;\n timestamp: number;\n}\n\nexport interface FarmNavigationBlockerContext {\n from: string;\n to: string;\n action: \"push\" | \"replace\" | \"pop\";\n}\n\nexport type FarmNavigationBlocker = (\n context: FarmNavigationBlockerContext,\n) => boolean | void | Promise<boolean | void>;\n\nexport type FarmViewTransitionMode = boolean | \"auto\";\n\nexport interface FarmNavigateOptions {\n replace?: boolean;\n scroll?: boolean;\n state?: unknown;\n viewTransition?: FarmViewTransitionMode;\n /** Re-fetch the current route even when its URL has not changed. */\n refresh?: boolean;\n}\n\nexport interface FarmNavigationLocation {\n href: string;\n pathname: string;\n search: string;\n hash: string;\n}\n\nexport interface FarmNavigationState {\n state: \"idle\" | \"loading\";\n pending: boolean;\n from: string | null;\n to: FarmNavigationLocation | null;\n action: FarmNavigationBlockerContext[\"action\"] | null;\n startedAt: number | null;\n}\n\nexport type FarmNavigationListener = (state: FarmNavigationState) => void;\n\nconst FARM_PAGE_STATE_KEY = \"__farmPageState\";\nconst FARM_INTERCEPT_FROM_KEY = \"__farmInterceptFrom\";\nconst IDLE_NAVIGATION_STATE: FarmNavigationState = {\n state: \"idle\",\n pending: false,\n from: null,\n to: null,\n action: null,\n startedAt: null,\n};\n\nfunction getActiveLayoutChainHeader(): string | undefined {\n if (typeof document === \"undefined\") return undefined;\n const patterns = Array.from(\n document.querySelectorAll<HTMLElement>('[data-farm-layout-boundary=\"true\"]'),\n )\n .map((element) => element.dataset.farmLayoutPattern)\n .filter((pattern): pattern is string => Boolean(pattern));\n return patterns.length > 0 ? JSON.stringify(patterns) : undefined;\n}\n\n// Global router instance\nlet routerInstance: SPARouter | null = null;\n\nexport class SPARouter {\n private cache: Map<string, CacheEntry> = new Map();\n private prefetchingUrls: Set<string> = new Set();\n private observers: Map<Element, IntersectionObserver> = new Map();\n private blockers: Set<FarmNavigationBlocker> = new Set();\n private navigationListeners: Set<FarmNavigationListener> = new Set();\n private navigationState: FarmNavigationState = IDLE_NAVIGATION_STATE;\n private scrollElements: Map<string, HTMLElement> = new Map();\n private options: Required<Omit<RouterOptions, \"deploymentId\">> &\n Pick<RouterOptions, \"deploymentId\">;\n private onNavigate?: (data: PageData) => Promise<void>;\n private clientPlugins?: Pick<\n FarmClientPluginManager,\n | \"beginNavigation\"\n | \"markNavigationLoaded\"\n | \"resolveNavigation\"\n | \"scheduleNavigationRendered\"\n | \"failNavigation\"\n >;\n\n private readonly onPopState = (event: PopStateEvent) => {\n void this.handlePopState(event);\n };\n\n private readonly onBeforeUnload = (event: BeforeUnloadEvent) => {\n if (this.blockers.size > 0) {\n event.preventDefault();\n event.returnValue = \"\";\n }\n this.saveScrollPosition(window.location.pathname);\n };\n\n constructor(options: RouterOptions = {}) {\n this.options = {\n prefetchTimeout: options.prefetchTimeout ?? 100,\n cacheMaxAge: options.cacheMaxAge ?? 30000, // 30 seconds\n scrollRestoration: options.scrollRestoration ?? true,\n shouldUseDocumentNavigation: options.shouldUseDocumentNavigation ?? (() => false),\n deploymentId: options.deploymentId ?? readBrowserDeploymentId(),\n };\n\n if (typeof window !== \"undefined\") {\n // Listen for popstate (back/forward navigation)\n window.addEventListener(\"popstate\", this.onPopState);\n\n // Save scroll position before unload\n window.addEventListener(\"beforeunload\", this.onBeforeUnload);\n }\n }\n\n /** Remove global listeners. Intended for tests and teardown. */\n destroy(): void {\n if (typeof window === \"undefined\") return;\n window.removeEventListener(\"popstate\", this.onPopState);\n window.removeEventListener(\"beforeunload\", this.onBeforeUnload);\n }\n\n /**\n * Set the navigation handler that updates React\n */\n setNavigationHandler(handler: (data: PageData) => Promise<void>) {\n this.onNavigate = handler;\n }\n\n /**\n * Connect Farm's browser plugin lifecycle to SPA navigation.\n */\n setClientPluginManager(manager: FarmClientPluginManager) {\n this.clientPlugins = manager;\n }\n\n /**\n * Navigate to a new URL\n */\n async navigate(href: string, options: FarmNavigateOptions = {}): Promise<void> {\n const {\n replace = false,\n scroll = true,\n state,\n viewTransition = false,\n refresh = false,\n } = options;\n\n // Parse the URL\n const url = new URL(href, window.location.origin);\n const pathname = url.pathname;\n const search = url.search;\n const fullPath = pathname + search;\n\n if (\n isFarmLocaleChangeHref(url.toString()) ||\n this.options.shouldUseDocumentNavigation(pathname)\n ) {\n if (replace) window.location.replace(url.toString());\n else window.location.assign(url.toString());\n return;\n }\n\n // Same page navigation - just update hash/scroll\n if (!refresh && pathname === window.location.pathname && search === window.location.search) {\n if (url.hash) {\n window.location.hash = url.hash;\n }\n return;\n }\n\n const from = window.location.pathname + window.location.search;\n if (\n await this.shouldBlockNavigation({\n from,\n to: fullPath,\n action: replace ? \"replace\" : \"push\",\n })\n ) {\n return;\n }\n\n // Save current scroll position\n if (this.options.scrollRestoration) {\n this.saveScrollPosition(window.location.pathname);\n }\n\n this.startNavigation({\n from,\n to: createNavigationLocation(url),\n action: replace ? \"replace\" : \"push\",\n });\n\n let clientNavigation: FarmClientNavigationSession | undefined;\n try {\n clientNavigation = await this.clientPlugins?.beginNavigation({\n from,\n to: url,\n action: replace ? \"replace\" : \"push\",\n });\n\n // Fetch page data (from cache or server)\n const pageData = await this.fetchPageData(fullPath, true, from, refresh);\n if (clientNavigation) {\n await this.clientPlugins?.markNavigationLoaded(clientNavigation, pageData);\n }\n\n await this.runViewTransition(viewTransition, () =>\n this.commitNavigation({\n fullPath,\n pageData,\n pathname,\n replace,\n scroll,\n state,\n url,\n }),\n );\n\n if (clientNavigation) {\n await this.clientPlugins?.resolveNavigation(clientNavigation);\n void this.clientPlugins?.scheduleNavigationRendered(clientNavigation);\n }\n this.finishNavigation();\n } catch (error) {\n if (clientNavigation) {\n await this.clientPlugins?.failNavigation(clientNavigation, error);\n }\n this.finishNavigation();\n console.error(\"[Farm.js] Navigation error:\", error);\n // Fall back to full page navigation\n window.location.href = href;\n }\n }\n\n /**\n * Re-render the active route from the server while preserving the document,\n * shared layouts, client runtime, and browser history entry.\n */\n refresh(options: Omit<FarmNavigateOptions, \"replace\" | \"refresh\"> = {}): Promise<void> {\n return this.navigate(window.location.href, {\n ...options,\n replace: true,\n refresh: true,\n scroll: options.scroll ?? false,\n });\n }\n\n /**\n * Prefetch a URL\n */\n async prefetch(href: string): Promise<void> {\n if (isFarmLocaleChangeHref(href)) return;\n const url = new URL(href, window.location.origin);\n const fullPath = url.pathname + url.search;\n const interceptFrom = window.location.pathname + window.location.search;\n\n // Skip if already prefetching or cached\n if (this.prefetchingUrls.has(fullPath)) return;\n if (this.isCached(fullPath, interceptFrom)) return;\n\n this.prefetchingUrls.add(fullPath);\n\n try {\n await this.fetchPageData(fullPath, false, interceptFrom);\n } catch (error) {\n console.warn(\"[Farm.js] Prefetch failed:\", href, error);\n } finally {\n this.prefetchingUrls.delete(fullPath);\n }\n }\n\n /**\n * Observe an element for viewport intersection (prefetch when visible)\n */\n observeForPrefetch(element: HTMLAnchorElement): void {\n if (typeof IntersectionObserver === \"undefined\") return;\n\n const href = element.getAttribute(\"href\");\n if (!href || this.isExternalUrl(href)) return;\n\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n // Delay prefetch slightly to avoid prefetching during scroll\n setTimeout(() => {\n this.prefetch(href);\n }, this.options.prefetchTimeout);\n\n // Stop observing after first intersection\n observer.unobserve(element);\n this.observers.delete(element);\n }\n }\n },\n { rootMargin: \"200px\" }, // Start prefetching when 200px from viewport\n );\n\n observer.observe(element);\n this.observers.set(element, observer);\n }\n\n /**\n * Stop observing an element\n */\n unobserveForPrefetch(element: HTMLAnchorElement): void {\n const observer = this.observers.get(element);\n if (observer) {\n observer.unobserve(element);\n this.observers.delete(element);\n }\n }\n\n addBlocker(blocker: FarmNavigationBlocker): () => void {\n this.blockers.add(blocker);\n return () => {\n this.blockers.delete(blocker);\n };\n }\n\n getNavigationState(): FarmNavigationState {\n return this.navigationState;\n }\n\n subscribeNavigation(listener: FarmNavigationListener): () => void {\n this.navigationListeners.add(listener);\n listener(this.navigationState);\n return () => {\n this.navigationListeners.delete(listener);\n };\n }\n\n registerScrollElement(key: string, element: HTMLElement): () => void {\n this.scrollElements.set(key, element);\n this.restoreScrollElement(window.location.pathname, key, element);\n return () => {\n if (this.scrollElements.get(key) === element) {\n this.scrollElements.delete(key);\n }\n };\n }\n\n pushState(state: unknown, href?: string): void {\n this.writePageState(\"push\", state, href);\n }\n\n replaceState(state: unknown, href?: string): void {\n this.writePageState(\"replace\", state, href);\n }\n\n private async commitNavigation(options: {\n fullPath: string;\n pageData: PageData;\n pathname: string;\n replace: boolean;\n scroll: boolean;\n state: unknown;\n url: URL;\n }): Promise<void> {\n const historyPath = options.pageData.canonicalPath || options.fullPath;\n const historyState = createHistoryState(\n historyPath,\n options.state,\n undefined,\n options.pageData.interception?.from ?? null,\n );\n if (options.replace) {\n window.history.replaceState(historyState, \"\", historyPath);\n } else {\n window.history.pushState(historyState, \"\", historyPath);\n }\n\n if (options.pageData.metadata?.title) {\n document.title = options.pageData.metadata.title;\n }\n\n if (options.pageData.metadata?.description) {\n let metaDesc = document.querySelector('meta[name=\"description\"]');\n if (!metaDesc) {\n metaDesc = document.createElement(\"meta\");\n metaDesc.setAttribute(\"name\", \"description\");\n document.head.appendChild(metaDesc);\n }\n metaDesc.setAttribute(\"content\", options.pageData.metadata.description);\n }\n\n _hydrateFarmI18n(options.pageData.i18n);\n\n if (this.onNavigate) {\n await this.onNavigate(options.pageData);\n }\n\n if (options.scroll) {\n if (options.url.hash) {\n const element = document.querySelector(options.url.hash);\n if (element) {\n element.scrollIntoView();\n }\n } else {\n window.scrollTo(0, 0);\n }\n } else if (this.options.scrollRestoration) {\n this.restoreScrollPosition(options.pathname);\n }\n }\n\n private async runViewTransition(\n mode: FarmViewTransitionMode,\n callback: () => Promise<void>,\n ): Promise<void> {\n if (!mode || typeof document === \"undefined\") {\n await callback();\n return;\n }\n\n const startViewTransition = (document as any).startViewTransition;\n if (typeof startViewTransition !== \"function\") {\n await callback();\n return;\n }\n\n const transition = startViewTransition.call(document, () => callback());\n const updateDone = transition?.updateCallbackDone || transition?.ready;\n if (updateDone && typeof updateDone.then === \"function\") {\n await updateDone;\n }\n transition?.finished?.catch?.(() => undefined);\n }\n\n /**\n * Fetch page data from cache or server\n */\n private async fetchPageData(\n path: string,\n recover = true,\n interceptFrom?: string,\n fresh = false,\n ): Promise<PageData> {\n const cacheKey = getPageDataCacheKey(path, interceptFrom);\n // Check cache first\n const cached = fresh ? undefined : this.cache.get(cacheKey);\n if (cached && Date.now() - cached.timestamp < this.options.cacheMaxAge) {\n return cached.data;\n }\n\n // Fetch from server. The active layout chain lets the server omit shared\n // shell HTML from the fragment without inspecting component source.\n const activeLayoutChain = getActiveLayoutChainHeader();\n const response = await fetch(`/__farm/page-data?path=${encodeURIComponent(path)}`, {\n headers: createFarmDeploymentRequestHeaders(this.options.deploymentId, {\n Accept: \"application/x-farm-deferred+json, application/json\",\n \"X-Farm-SPA\": \"1\",\n ...(activeLayoutChain ? { \"X-Farm-Layout-Chain\": activeLayoutChain } : {}),\n ...(interceptFrom ? { \"X-Farm-Intercept-From\": interceptFrom } : {}),\n }),\n });\n\n if (isFarmDeploymentMismatchResponse(response, this.options.deploymentId)) {\n const error = createFarmDeploymentMismatchError(\n response,\n this.options.deploymentId || \"unknown\",\n );\n dispatchDeploymentMismatch(error);\n if (recover) {\n window.location.assign(path);\n }\n throw error;\n }\n\n if (!response.ok) {\n throw new Error(`Failed to fetch page data: ${response.status}`);\n }\n\n const data = await readDeferredDataResponse<PageData>(response);\n\n // Cache the result\n this.cache.set(cacheKey, {\n data,\n timestamp: Date.now(),\n });\n\n return data;\n }\n\n /**\n * Handle browser back/forward navigation\n */\n private async handlePopState(event: PopStateEvent): Promise<void> {\n if (document.documentElement.dataset.farmDocsRuntime === \"true\") return;\n\n const path = window.location.pathname + window.location.search;\n\n if (\n await this.shouldBlockNavigation({\n from: event.state?.path || path,\n to: path,\n action: \"pop\",\n })\n ) {\n return;\n }\n\n this.startNavigation({\n from: event.state?.path || path,\n to: createNavigationLocation(new URL(window.location.href)),\n action: \"pop\",\n });\n\n let clientNavigation: FarmClientNavigationSession | undefined;\n try {\n clientNavigation = await this.clientPlugins?.beginNavigation({\n from: null,\n to: window.location.href,\n action: \"pop\",\n });\n const interceptFrom =\n typeof event.state?.[FARM_INTERCEPT_FROM_KEY] === \"string\"\n ? event.state[FARM_INTERCEPT_FROM_KEY]\n : undefined;\n const pageData = await this.fetchPageData(path, true, interceptFrom);\n if (clientNavigation) {\n await this.clientPlugins?.markNavigationLoaded(clientNavigation, pageData);\n }\n\n // Update document title\n if (pageData.metadata?.title) {\n document.title = pageData.metadata.title;\n }\n\n _hydrateFarmI18n(pageData.i18n);\n\n // Call the navigation handler to update React\n if (this.onNavigate) {\n await this.onNavigate(pageData);\n }\n\n // Restore scroll position\n if (this.options.scrollRestoration) {\n this.restoreScrollPosition(window.location.pathname);\n }\n\n if (clientNavigation) {\n await this.clientPlugins?.resolveNavigation(clientNavigation);\n void this.clientPlugins?.scheduleNavigationRendered(clientNavigation);\n }\n this.finishNavigation();\n } catch (error) {\n if (clientNavigation) {\n await this.clientPlugins?.failNavigation(clientNavigation, error);\n }\n this.finishNavigation();\n console.error(\"[Farm.js] Popstate navigation error:\", error);\n // Reload the page as fallback\n window.location.reload();\n }\n }\n\n /**\n * Check if URL is cached\n */\n private isCached(path: string, interceptFrom?: string): boolean {\n const cached = this.cache.get(getPageDataCacheKey(path, interceptFrom));\n return cached !== undefined && Date.now() - cached.timestamp < this.options.cacheMaxAge;\n }\n\n /**\n * Check if URL is external\n */\n private isExternalUrl(href: string): boolean {\n return href.startsWith(\"http://\") || href.startsWith(\"https://\") || href.startsWith(\"//\");\n }\n\n private async shouldBlockNavigation(context: FarmNavigationBlockerContext): Promise<boolean> {\n for (const blocker of this.blockers) {\n if (await blocker(context)) {\n return true;\n }\n }\n return false;\n }\n\n private startNavigation(options: {\n from: string;\n to: FarmNavigationLocation;\n action: FarmNavigationBlockerContext[\"action\"];\n }): void {\n this.setNavigationState({\n state: \"loading\",\n pending: true,\n from: options.from,\n to: options.to,\n action: options.action,\n startedAt: Date.now(),\n });\n }\n\n private finishNavigation(): void {\n this.setNavigationState(IDLE_NAVIGATION_STATE);\n }\n\n private setNavigationState(state: FarmNavigationState): void {\n this.navigationState = state;\n for (const listener of this.navigationListeners) {\n listener(state);\n }\n }\n\n private writePageState(action: \"push\" | \"replace\", state: unknown, href?: string): void {\n if (typeof window === \"undefined\") return;\n\n const url = href ? new URL(href, window.location.origin).toString() : window.location.href;\n const nextState = createHistoryState(\n new URL(url).pathname + new URL(url).search,\n state,\n window.history.state,\n );\n\n if (action === \"replace\") {\n window.history.replaceState(nextState, \"\", url);\n } else {\n window.history.pushState(nextState, \"\", url);\n }\n\n window.dispatchEvent(new PopStateEvent(\"popstate\", { state: nextState }));\n }\n\n /**\n * Save scroll position for a path\n */\n private saveScrollPosition(path: string): void {\n try {\n sessionStorage.setItem(\n `farm-scroll-${path}`,\n JSON.stringify({ x: window.scrollX, y: window.scrollY }),\n );\n for (const [key, element] of this.scrollElements) {\n sessionStorage.setItem(\n getScrollElementStorageKey(path, key),\n JSON.stringify({ x: element.scrollLeft, y: element.scrollTop }),\n );\n }\n } catch {\n // Ignore storage errors\n }\n }\n\n /**\n * Restore scroll position for a path\n */\n private restoreScrollPosition(path: string): void {\n try {\n const saved = sessionStorage.getItem(`farm-scroll-${path}`);\n if (saved) {\n const { x, y } = JSON.parse(saved);\n setTimeout(() => window.scrollTo(x, y), 0);\n }\n for (const [key, element] of this.scrollElements) {\n this.restoreScrollElement(path, key, element);\n }\n } catch {\n // Ignore storage errors\n }\n }\n\n private restoreScrollElement(path: string, key: string, element: HTMLElement): void {\n try {\n const saved = sessionStorage.getItem(getScrollElementStorageKey(path, key));\n if (!saved) return;\n const { x, y } = JSON.parse(saved);\n setTimeout(() => {\n element.scrollLeft = x;\n element.scrollTop = y;\n }, 0);\n } catch {\n // Ignore storage errors\n }\n }\n\n /**\n * Clear the page cache\n */\n clearCache(): void {\n this.cache.clear();\n }\n}\n\nfunction readBrowserDeploymentId(): string | undefined {\n if (typeof window === \"undefined\") return undefined;\n\n const runtimeId = (window as Window & { __FARM_DEPLOYMENT_ID__?: unknown })\n .__FARM_DEPLOYMENT_ID__;\n if (typeof runtimeId === \"string\" && runtimeId) return runtimeId;\n\n return document.querySelector<HTMLMetaElement>('meta[name=\"farm-deployment-id\"]')?.content;\n}\n\nfunction dispatchDeploymentMismatch(error: Error): void {\n if (typeof window === \"undefined\" || typeof CustomEvent === \"undefined\") return;\n window.dispatchEvent(new CustomEvent(\"farm:deployment-mismatch\", { detail: error }));\n}\n\n/**\n * Get or create the global router instance\n */\nexport function getInstalledFarmSPARouter(): SPARouter | undefined {\n if (typeof window === \"undefined\") return undefined;\n return (window as Window & { __FARM_SPA_ROUTER__?: SPARouter }).__FARM_SPA_ROUTER__;\n}\n\nexport function getRouter(): SPARouter {\n if (typeof window === \"undefined\") {\n // Return a no-op router for SSR\n return new SPARouter();\n }\n\n const installedRouter = getInstalledFarmSPARouter();\n if (installedRouter) {\n routerInstance = installedRouter;\n return installedRouter;\n }\n\n if (!routerInstance) {\n routerInstance = new SPARouter();\n }\n\n return routerInstance;\n}\n\n/**\n * Navigate to a URL using the SPA router\n */\nexport function navigateTo(href: string, options?: FarmNavigateOptions): Promise<void> {\n return getRouter().navigate(href, options);\n}\n\n/**\n * Prefetch a URL\n */\nexport function prefetch(href: string): Promise<void> {\n return getRouter().prefetch(href);\n}\n\nexport function pushState(state: unknown, href?: string): void {\n getRouter().pushState(state, href);\n}\n\nexport function replaceState(state: unknown, href?: string): void {\n getRouter().replaceState(state, href);\n}\n\nexport function readPageState<TState = unknown>(): TState | null {\n if (typeof window === \"undefined\") return null;\n const state = window.history.state;\n if (!state || typeof state !== \"object\") return null;\n return ((state as Record<string, unknown>)[FARM_PAGE_STATE_KEY] as TState | undefined) ?? null;\n}\n\nfunction createHistoryState(\n path: string,\n pageState: unknown,\n currentState?: unknown,\n interceptFrom?: string | null,\n) {\n const base =\n currentState && typeof currentState === \"object\" ? { ...(currentState as object) } : {};\n const nextState: Record<string, unknown> = {\n ...base,\n path,\n [FARM_PAGE_STATE_KEY]: pageState,\n };\n if (interceptFrom === null) {\n delete nextState[FARM_INTERCEPT_FROM_KEY];\n } else if (interceptFrom) {\n nextState[FARM_INTERCEPT_FROM_KEY] = interceptFrom;\n }\n return nextState;\n}\n\nfunction getPageDataCacheKey(path: string, interceptFrom?: string): string {\n return interceptFrom ? `${path}\\nintercept:${interceptFrom}` : path;\n}\n\nfunction createNavigationLocation(url: URL): FarmNavigationLocation {\n return {\n href: url.href,\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n };\n}\n\nfunction getScrollElementStorageKey(path: string, key: string): string {\n return `farm-scroll-${path}:${key}`;\n}\n","import { getInstalledFarmSPARouter } from \"./spa-router\";\n\n/** Fired after programmatic query-string updates when Farm SPA router is active. */\nexport const FARM_URL_SEARCH_CHANGE_EVENT = \"farm:urlsearchchange\";\n\n/**\n * Notify URL observers after history.pushState/replaceState updates the query string.\n *\n * nuqs uses `shallow: true` for client-only URL updates and dispatches synthetic\n * `popstate` so other hooks resync. Farm's SPA router also listens to `popstate`\n * for full document navigation, so when `__FARM_SPA_ROUTER__` is installed we emit a\n * dedicated event instead and keep `popstate` for real back/forward navigation.\n */\nexport function notifyUrlSearchObservers(shallow: boolean): void {\n if (!shallow || typeof window === \"undefined\") return;\n\n setTimeout(() => {\n if (getInstalledFarmSPARouter()) {\n window.dispatchEvent(new CustomEvent(FARM_URL_SEARCH_CHANGE_EVENT));\n return;\n }\n\n window.dispatchEvent(new PopStateEvent(\"popstate\"));\n }, 0);\n}\n\nexport function subscribeUrlSearchObservers(listener: () => void): () => void {\n if (typeof window === \"undefined\") return () => {};\n\n window.addEventListener(\"popstate\", listener);\n window.addEventListener(FARM_URL_SEARCH_CHANGE_EVENT, listener);\n\n return () => {\n window.removeEventListener(\"popstate\", listener);\n window.removeEventListener(FARM_URL_SEARCH_CHANGE_EVENT, listener);\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoHA,IAAM,sBAAsB;AAC5B,IAAM,0BAA0B;AAChC,IAAM,wBAA6C;AAAA,EACjD,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,E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
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createFarmRouter
|
|
3
|
+
} from "./chunk-ZBE6MLHL.mjs";
|
|
1
4
|
import {
|
|
2
5
|
getRouter,
|
|
3
|
-
readPageState
|
|
4
|
-
|
|
6
|
+
readPageState,
|
|
7
|
+
subscribeUrlSearchObservers
|
|
8
|
+
} from "./chunk-YBHLSG7E.mjs";
|
|
5
9
|
import {
|
|
6
10
|
getFarmI18nClientState
|
|
7
11
|
} from "./chunk-ITN462YM.mjs";
|
|
8
|
-
import {
|
|
9
|
-
createFarmRouter
|
|
10
|
-
} from "./chunk-ZBE6MLHL.mjs";
|
|
11
12
|
import {
|
|
12
13
|
stripFarmLocaleFromPathname
|
|
13
14
|
} from "./chunk-44ZCFSKE.mjs";
|
|
@@ -34,8 +35,8 @@ function useRouter(options = {}) {
|
|
|
34
35
|
setState(readRouterState(basePath, routeMatcher));
|
|
35
36
|
}, "handlePopState");
|
|
36
37
|
handlePopState();
|
|
37
|
-
|
|
38
|
-
return
|
|
38
|
+
const unsubscribe = subscribeUrlSearchObservers(handlePopState);
|
|
39
|
+
return unsubscribe;
|
|
39
40
|
}, [basePath, routeMatcher]);
|
|
40
41
|
const push = /* @__PURE__ */ __name((href) => {
|
|
41
42
|
if (typeof window === "undefined") return;
|
|
@@ -178,4 +179,4 @@ export {
|
|
|
178
179
|
useBlocker,
|
|
179
180
|
useScrollRestoration
|
|
180
181
|
};
|
|
181
|
-
//# sourceMappingURL=chunk-
|
|
182
|
+
//# sourceMappingURL=chunk-ZP5IWDTE.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/client/router.ts"],"sourcesContent":["import { useEffect, useMemo, useRef, useState, type RefObject } from \"react\";\nimport { createFarmRouter, type FarmRouter, type FarmRouterRouteInput } from \"../router\";\nimport {\n getRouter as getSPARouter,\n readPageState,\n type FarmNavigationBlockerContext,\n type FarmNavigationState,\n} from \"./spa-router\";\nimport { subscribeUrlSearchObservers } from \"./url-search-sync\";\nimport { getFarmI18nClientState } from \"../i18n/client-runtime\";\nimport { stripFarmLocaleFromPathname } from \"../i18n/routing\";\n\ninterface RouterState {\n pathname: string;\n searchParams: URLSearchParams;\n params: Record<string, string>;\n pageState: unknown;\n}\n\nexport interface UseRouterOptions {\n basePath?: string;\n routes?: FarmRouterRouteInput[];\n}\n\nexport interface UseBlockerOptions {\n when: boolean | ((context: FarmNavigationBlockerContext) => boolean);\n message?: string;\n shouldBlock?: (context: FarmNavigationBlockerContext) => boolean | Promise<boolean>;\n}\n\nexport interface UseBlockerReturn {\n active: boolean;\n}\n\n/**\n * Hook for accessing router state and navigation\n */\nexport function useRouter(options: UseRouterOptions = {}) {\n const basePath = options.basePath || \"\";\n const routes = options.routes;\n const routeKey =\n routes?.map((route) => (typeof route === \"string\" ? route : route.path)).join(\"\\n\") || \"\";\n const routeMatcher = useMemo(\n () => (routeKey ? createFarmRouter(routeKey.split(\"\\n\")) : null),\n [routeKey],\n );\n const [state, setState] = useState<RouterState>(() => {\n return readRouterState(basePath, routeMatcher);\n });\n\n useEffect(() => {\n if (typeof window === \"undefined\") return;\n\n const handlePopState = () => {\n setState(readRouterState(basePath, routeMatcher));\n };\n\n handlePopState();\n const unsubscribe = subscribeUrlSearchObservers(handlePopState);\n return unsubscribe;\n }, [basePath, routeMatcher]);\n\n const push = (href: string) => {\n if (typeof window === \"undefined\") return;\n\n const url = href.startsWith(\"/\") ? basePath + href : href;\n window.history.pushState(null, \"\", url);\n window.dispatchEvent(new PopStateEvent(\"popstate\"));\n };\n\n const replace = (href: string) => {\n if (typeof window === \"undefined\") return;\n\n const url = href.startsWith(\"/\") ? basePath + href : href;\n window.history.replaceState(null, \"\", url);\n window.dispatchEvent(new PopStateEvent(\"popstate\"));\n };\n\n const pushState = <TState>(pageState: TState, href?: string) => {\n if (typeof window === \"undefined\") return;\n getSPARouter().pushState(pageState, resolveClientHref(href, basePath));\n };\n\n const replaceState = <TState>(pageState: TState, href?: string) => {\n if (typeof window === \"undefined\") return;\n getSPARouter().replaceState(pageState, resolveClientHref(href, basePath));\n };\n\n const back = () => {\n if (typeof window !== \"undefined\") {\n window.history.back();\n }\n };\n\n const forward = () => {\n if (typeof window !== \"undefined\") {\n window.history.forward();\n }\n };\n\n return {\n ...state,\n push,\n replace,\n pushState,\n replaceState,\n back,\n forward,\n };\n}\n\nexport function usePageState<TState = unknown>(): TState | null {\n const [state, setState] = useState<TState | null>(() => readPageState<TState>());\n\n useEffect(() => {\n if (typeof window === \"undefined\") return;\n\n const handlePopState = () => {\n setState(readPageState<TState>());\n };\n\n handlePopState();\n window.addEventListener(\"popstate\", handlePopState);\n return () => window.removeEventListener(\"popstate\", handlePopState);\n }, []);\n\n return state;\n}\n\nexport function useNavigation(): FarmNavigationState {\n const [state, setState] = useState<FarmNavigationState>(() =>\n getSPARouter().getNavigationState(),\n );\n\n useEffect(() => {\n if (typeof window === \"undefined\") return;\n return getSPARouter().subscribeNavigation(setState);\n }, []);\n\n return state;\n}\n\nexport function useBlocker(options: UseBlockerOptions): UseBlockerReturn {\n const optionsRef = useRef(options);\n optionsRef.current = options;\n const active = Boolean(options.when);\n\n useEffect(() => {\n if (typeof window === \"undefined\" || !active) {\n return;\n }\n\n return getSPARouter().addBlocker(async (context) => {\n const current = optionsRef.current;\n const when = typeof current.when === \"function\" ? current.when(context) : current.when;\n\n if (!when) return false;\n\n if (current.shouldBlock && !(await current.shouldBlock(context))) {\n return false;\n }\n\n if (current.message && typeof window.confirm === \"function\") {\n return !window.confirm(current.message);\n }\n\n return true;\n });\n }, [active]);\n\n return { active };\n}\n\nexport function useScrollRestoration<TElement extends HTMLElement = HTMLElement>(\n key: string,\n): RefObject<TElement | null> {\n const ref = useRef<TElement>(null);\n\n useEffect(() => {\n const element = ref.current;\n if (!element) return;\n return getSPARouter().registerScrollElement(key, element);\n }, [key]);\n\n return ref;\n}\n\nfunction readRouterState(basePath: string, routeMatcher: FarmRouter | null): RouterState {\n if (typeof window === \"undefined\") {\n return {\n pathname: \"/\",\n searchParams: new URLSearchParams(),\n params: {},\n pageState: null,\n };\n }\n\n const url = new URL(window.location.href);\n const pathname = normalizeClientPathname(url.pathname, basePath);\n const i18n = getFarmI18nClientState();\n const routePathname = i18n ? stripFarmLocaleFromPathname(pathname, i18n) : pathname;\n return {\n pathname,\n searchParams: url.searchParams,\n params: routeMatcher?.match(routePathname)?.params || {},\n pageState: readPageState(),\n };\n}\n\nfunction normalizeClientPathname(pathname: string, basePath: string) {\n const normalizedBase = basePath.replace(/\\/+$/, \"\");\n const isUnderBase =\n normalizedBase && (pathname === normalizedBase || pathname.startsWith(`${normalizedBase}/`));\n const withoutBase = isUnderBase ? pathname.slice(normalizedBase.length) || \"/\" : pathname;\n return withoutBase || \"/\";\n}\n\nfunction resolveClientHref(href: string | undefined, basePath: string): string | undefined {\n if (!href) return undefined;\n return href.startsWith(\"/\") ? basePath + href : href;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,SAAS,WAAW,SAAS,QAAQ,gBAAgC;AAqC9D,SAAS,UAAU,UAA4B,CAAC,GAAG;AACxD,QAAM,WAAW,QAAQ,YAAY;AACrC,QAAM,SAAS,QAAQ;AACvB,QAAM,WACJ,QAAQ,IAAI,CAAC,UAAW,OAAO,UAAU,WAAW,QAAQ,MAAM,IAAK,EAAE,KAAK,IAAI,KAAK;AACzF,QAAM,eAAe;AAAA,IACnB,MAAO,WAAW,iBAAiB,SAAS,MAAM,IAAI,CAAC,IAAI;AAAA,IAC3D,CAAC,QAAQ;AAAA,EACX;AACA,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAsB,MAAM;AACpD,WAAO,gBAAgB,UAAU,YAAY;AAAA,EAC/C,CAAC;AAED,YAAU,MAAM;AACd,QAAI,OAAO,WAAW,YAAa;AAEnC,UAAM,iBAAiB,6BAAM;AAC3B,eAAS,gBAAgB,UAAU,YAAY,CAAC;AAAA,IAClD,GAFuB;AAIvB,mBAAe;AACf,UAAM,cA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chunk-FXG2PS27.mjs";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-BLTATPSB.mjs";
|
|
7
7
|
import "../chunk-CGILA3WO.mjs";
|
|
8
8
|
export {
|
|
9
9
|
defineClient
|