@farm.js/plugin 0.1.68 → 0.1.70
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/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/rsc/config-routes.d.ts +53 -0
- package/dist/rsc/config-routes.d.ts.map +1 -0
- package/dist/rsc/config-routes.js +136 -0
- package/dist/rsc/entries/client.d.ts +2 -0
- package/dist/rsc/entries/client.d.ts.map +1 -1
- package/dist/rsc/entries/client.js +72 -24
- package/dist/rsc/entries/rsc.d.ts +14 -0
- package/dist/rsc/entries/rsc.d.ts.map +1 -1
- package/dist/rsc/entries/rsc.js +1140 -88
- package/dist/rsc/index.d.ts +15 -10
- package/dist/rsc/index.d.ts.map +1 -1
- package/dist/rsc/index.js +190 -30
- package/dist/rsc/test-fixture-dependencies.d.ts +2 -0
- package/dist/rsc/test-fixture-dependencies.d.ts.map +1 -1
- package/dist/rsc/test-fixture-dependencies.js +2 -0
- package/dist/rsc/types.d.ts +53 -4
- package/dist/rsc/types.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/rsc/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ import type { FarmServerConfig } from "@farm.js/core/internal/production-runtime
|
|
|
30
30
|
import type { FarmLayerEntry, ResolvedFarmLayer } from "@farm.js/core/server";
|
|
31
31
|
import { resolveFarmImageConfig } from "@farm.js/core/vite";
|
|
32
32
|
import { type FarmMarkdownUserConfig } from "@farm.js/core/markdown";
|
|
33
|
-
import type { FarmLlmsTxtUserConfig } from "@farm.js/core/internal/production-runtime";
|
|
33
|
+
import type { FarmAgentCrawlers, FarmAgentSitemapUserConfig, FarmLlmsTxtUserConfig } from "@farm.js/core/internal/production-runtime";
|
|
34
34
|
import type { FarmMCPUserConfig } from "@farm.js/core/server";
|
|
35
35
|
export type { FarmRscPluginOptions, EntryContext };
|
|
36
36
|
export { buildRscNitro, waitForRscManifest, waitForRscOutputs } from "./nitro-build.js";
|
|
@@ -44,6 +44,12 @@ export interface FarmRscConfig {
|
|
|
44
44
|
layers?: readonly ResolvedFarmLayer[];
|
|
45
45
|
outDir?: string;
|
|
46
46
|
basePath?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Same as core's `trailingSlash`: pages answer at `/about/`, `<Link>` renders that URL, and
|
|
49
|
+
* `/about` redirects (308) to it. Without it, `/about/` redirects to `/about`.
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
trailingSlash?: boolean;
|
|
47
53
|
api?: FarmAPIConfig;
|
|
48
54
|
server?: FarmServerConfig;
|
|
49
55
|
middleware?: FarmMiddlewareConfig;
|
|
@@ -96,12 +102,17 @@ export interface FarmRscConfig {
|
|
|
96
102
|
/**
|
|
97
103
|
* Agent-facing files. `llmsTxt` serves `/llms.txt`, an index of the app's
|
|
98
104
|
* static pages that links to their Markdown mirrors, and with `full: true`
|
|
99
|
-
* also `/llms-full.txt`, which inlines them.
|
|
100
|
-
* `agent.llmsTxt
|
|
101
|
-
*
|
|
105
|
+
* also `/llms-full.txt`, which inlines them. `sitemap` serves `/sitemap.xml`
|
|
106
|
+
* of the same pages. Same options as core's `agent.llmsTxt` and
|
|
107
|
+
* `agent.sitemap`; `false` turns each off. `crawlers` serves a generated
|
|
108
|
+
* `/robots.txt` for AI search and training crawlers, off by default, with the
|
|
109
|
+
* same options as core's `agent.crawlers`.
|
|
110
|
+
* @default { llmsTxt: { full: false }, sitemap: true }
|
|
102
111
|
*/
|
|
103
112
|
agent?: {
|
|
104
113
|
llmsTxt?: boolean | FarmLlmsTxtUserConfig;
|
|
114
|
+
sitemap?: boolean | FarmAgentSitemapUserConfig;
|
|
115
|
+
crawlers?: boolean | FarmAgentCrawlers;
|
|
105
116
|
};
|
|
106
117
|
/**
|
|
107
118
|
* An MCP endpoint for agents, with the same options as core's top-level
|
|
@@ -124,11 +135,5 @@ export interface FarmRscConfig {
|
|
|
124
135
|
* This is the recommended way to configure your RSC app
|
|
125
136
|
*/
|
|
126
137
|
export declare function defineConfig(config?: FarmRscConfig): UserConfig;
|
|
127
|
-
/**
|
|
128
|
-
* Farm.js RSC Plugin
|
|
129
|
-
*
|
|
130
|
-
* @param options - Plugin configuration options
|
|
131
|
-
* @returns Array of Vite plugins
|
|
132
|
-
*/
|
|
133
138
|
export default function farmRsc(options?: FarmRscPluginOptions): Plugin[];
|
|
134
139
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/rsc/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rsc/index.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAIL,KAAK,MAAM,EACX,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rsc/index.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAIL,KAAK,MAAM,EACX,KAAK,UAAU,EAEhB,MAAM,MAAM,CAAC;AAUd,OAAO,KAAK,EACV,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAI9E,OAAO,EAQL,sBAAsB,EAIvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAyB,KAAK,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAC5F,OAAO,KAAK,EACV,iBAAiB,EACjB,0B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ule, FarmDevEnvironmentError } from "@farm.js/core/plugin
|
|
|
24
24
|
*/
|
|
25
25
|
import { parseAst, version as viteVersion, } from "vite";
|
|
26
26
|
import { init as initModuleLexer, parse as parseModuleImports } from "es-module-lexer";
|
|
27
|
+
import { createRscConfigRouteMatchers, createRscConfigRoutesMiddleware, resolveRscConfigRoutes, } from "./config-routes.js";
|
|
27
28
|
import { isRscWorkersPreset } from "./presets.js";
|
|
28
29
|
import { createReactProductionModePlugin } from "@farm.js/core/internal/production-node-env";
|
|
29
30
|
import { farmEnvironmentFunctionsPlugin } from "@farm.js/core/environment/vite";
|
|
30
31
|
import { collectDevStylesheetUrls, farmFontImportsPlugin, farmImageImportsPlugin, generateClientCachePersistenceCode, getPublicFarmImageConfig, resolveFarmClientCacheAdapterEntry, resolveFarmClientOptimizeDeps, resolveFarmImageConfig, resolveFarmImageProviderForRuntime, resolveFarmImageServerRuntime, readRouteRenderingDirectiveFromFile, } from "@farm.js/core/vite";
|
|
31
|
-
import { generateRscEntry } from "./entries/rsc.js";
|
|
32
|
+
import { FARM_METADATA_IMAGE_QUERY, generateRscEntry } from "./entries/rsc.js";
|
|
32
33
|
import { resolveMarkdownConfig } from "@farm.js/core/markdown";
|
|
33
34
|
import { generateSsrEntry } from "./entries/ssr.js";
|
|
34
35
|
import { generateErrorFallbackEntry } from "./entries/error-fallback.js";
|
|
35
|
-
import { CLIENT_ENTRY_CORE_IMPORTS, generateClientEntry, serverFnTransportErrorClientRuntime, } from "./entries/client.js";
|
|
36
|
+
import { CLIENT_ENTRY_CORE_IMPORTS, CLIENT_ENTRY_I18N_IMPORTS, generateClientEntry, serverFnTransportErrorClientRuntime, } from "./entries/client.js";
|
|
36
37
|
import { transformFarmRouteActionClients } from "./route-action-transform.js";
|
|
37
38
|
import { createFarmServerFnBoundaryModule, isFarmServerFnBoundaryId, transformFarmServerFns, } from "./server-fn-transform.js";
|
|
38
39
|
import { transformAutomaticOptimizedBoundaries } from "./automatic-optimized-boundary.js";
|
|
@@ -56,8 +57,8 @@ const { FARM_VERSION } = require_("@farm.js/core/version");
|
|
|
56
57
|
const { farmMiddlewarePlugin } = require_("@farm.js/core/middleware");
|
|
57
58
|
const { resolveServerActionsConfig, validateServerActionRequest, createServerActionRequestErrorResponse, } = require_("@farm.js/core/server-action-security");
|
|
58
59
|
const { normalizeFarmDeploymentId } = require_("@farm.js/core/deployment");
|
|
59
|
-
const { getFarmLayerAliases, getFarmSourceRoots, resolveFarmLayers, resolveFarmMCPConfig, resolveFarmMCPPlugin, } = require_("@farm.js/core/server");
|
|
60
|
-
const { readNodeRequestBody, resolveFarmServerConfig, resolveFarmI18nConfig, createFarmRequestBodyErrorResponse, createDefaultErrorMarkup, resolveFarmLlmsTxtConfig, } = require_("@farm.js/core/internal/production-runtime");
|
|
60
|
+
const { getFarmLayerAliases, getFarmSourceRoots, inspectStaticMetadataImage, isOptionalPeerInstalled, resolveFarmLayers, resolveFarmMCPConfig, resolveFarmMCPPlugin, VERCEL_OG_INSTALL_HINT, } = require_("@farm.js/core/server");
|
|
61
|
+
const { readNodeRequestBody, resolveFarmServerConfig, resolveFarmI18nConfig, createFarmRequestBodyErrorResponse, createDefaultErrorMarkup, resolveFarmLlmsTxtConfig, resolveFarmAgentSitemap, resolveFarmAgentCrawlers, } = require_("@farm.js/core/internal/production-runtime");
|
|
61
62
|
const { isFarmAPIPathname } = require_("@farm.js/core/api/runtime");
|
|
62
63
|
const { resolveFarmAPIConfig, resolveFarmAPIServerBasePath } = require_("@farm.js/core/api");
|
|
63
64
|
const { getResolvedEnv } = require_("@farm.js/core/env");
|
|
@@ -65,6 +66,20 @@ export { buildRscNitro, waitForRscManifest, waitForRscOutputs } from "./nitro-bu
|
|
|
65
66
|
import { registerRscNitroRuntimePackage } from "./nitro-build.js";
|
|
66
67
|
export { default as nitro } from "./vite-plugin-nitro.js";
|
|
67
68
|
const PAGE_FILE = /^page\.(tsx|jsx|ts|js)$/;
|
|
69
|
+
/** Core's metadata route files. */
|
|
70
|
+
const METADATA_ROUTE_FILE = /^(sitemap|robots|manifest|llms|llms-full)\.(ts|js)$/;
|
|
71
|
+
/** Core's metadata image files: a generated module or a static image. */
|
|
72
|
+
const METADATA_IMAGE_FILE = /^(opengraph-image|twitter-image)\.(tsx|jsx|ts|js|png|jpg|jpeg|gif|webp)$/;
|
|
73
|
+
const STATIC_METADATA_IMAGE_FILE = /\.(png|jpg|jpeg|gif|webp)$/;
|
|
74
|
+
/** The static metadata image files the entry globs, and so the only files its loader reads. */
|
|
75
|
+
const STATIC_METADATA_IMAGE_NAME = /^(opengraph-image|twitter-image)\.(png|jpg|jpeg|gif|webp)$/;
|
|
76
|
+
/** Whether `file` is inside one of `roots` (each resolved, without a trailing separator). */
|
|
77
|
+
function isFileInsideRoots(file, roots) {
|
|
78
|
+
return roots.some((root) => {
|
|
79
|
+
const relative = path.relative(root, file);
|
|
80
|
+
return relative !== "" && !relative.startsWith("..") && !path.isAbsolute(relative);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
68
83
|
/** Packages the generated RSC entries import that belong to this plugin, not to the app. */
|
|
69
84
|
const PLUGIN_OWNED_ENTRY_IMPORTS = ["rsc-html-stream/server", "rsc-html-stream/client"];
|
|
70
85
|
/**
|
|
@@ -87,6 +102,7 @@ export function defineConfig(config = {}) {
|
|
|
87
102
|
layers: config.layers,
|
|
88
103
|
outDir: config.outDir ?? "dist",
|
|
89
104
|
basePath: config.basePath ?? "/",
|
|
105
|
+
trailingSlash: config.trailingSlash,
|
|
90
106
|
api: config.api,
|
|
91
107
|
serverActions: config.serverActions,
|
|
92
108
|
deploymentId: config.deploymentId,
|
|
@@ -527,6 +543,27 @@ async function rewriteCoreRuntimeImports(code, id) {
|
|
|
527
543
|
* @param options - Plugin configuration options
|
|
528
544
|
* @returns Array of Vite plugins
|
|
529
545
|
*/
|
|
546
|
+
/**
|
|
547
|
+
* The RSC entry, loaded in the "rsc" environment so @vitejs/plugin-rsc transforms run with
|
|
548
|
+
* this.environment.name === "rsc". Never evaluate an RSC entry with SSR conditions or share its
|
|
549
|
+
* module cache.
|
|
550
|
+
*/
|
|
551
|
+
async function loadRscDevEntry(server) {
|
|
552
|
+
const rscEnv = server.environments.rsc;
|
|
553
|
+
if (!rscEnv) {
|
|
554
|
+
throw new FarmDevEnvironmentError('[Farm.js] The "rsc" development environment is missing. Enable @vitejs/plugin-rsc before serving RSC requests.');
|
|
555
|
+
}
|
|
556
|
+
const rscSource = rscEnv.config?.build?.rollupOptions?.input?.index ??
|
|
557
|
+
"./.farm/rsc-entries/entry.rsc.tsx";
|
|
558
|
+
const root = server.config.root;
|
|
559
|
+
const importer = path.join(root, "vite.config.ts");
|
|
560
|
+
const absoluteRscEntry = path.resolve(root, ".farm", "rsc-entries", "entry.rsc.tsx");
|
|
561
|
+
const resolved = (await rscEnv.pluginContainer.resolveId(rscSource, importer)) ??
|
|
562
|
+
(await rscEnv.pluginContainer.resolveId(rscSource)) ??
|
|
563
|
+
(await rscEnv.pluginContainer.resolveId(absoluteRscEntry));
|
|
564
|
+
const id = resolved?.id ?? pathToFileURL(absoluteRscEntry).href;
|
|
565
|
+
return loadFarmDevModule(server, id, "rsc");
|
|
566
|
+
}
|
|
530
567
|
export default function farmRsc(options = {}) {
|
|
531
568
|
let rscEnabled = false;
|
|
532
569
|
let actionsEnabled = false;
|
|
@@ -537,8 +574,12 @@ export default function farmRsc(options = {}) {
|
|
|
537
574
|
let rscBuildRoot;
|
|
538
575
|
/** The app root, when this build adds the mobile client entry. */
|
|
539
576
|
let mobileClientRoot;
|
|
577
|
+
/** The config redirects(), rewrites() and headers() the dev server applies, when set. */
|
|
578
|
+
let devConfigRoutes;
|
|
540
579
|
const middlewareConfigModules = new Map();
|
|
541
580
|
let mcpConfigCandidates = null;
|
|
581
|
+
/** The app's route roots (and their real paths): the only places metadata images load from. */
|
|
582
|
+
let metadataImageRoots = [];
|
|
542
583
|
// Store for debugging
|
|
543
584
|
const debug = options.debug ?? false;
|
|
544
585
|
const automaticDeploymentId = `build-${Date.now()}`;
|
|
@@ -680,6 +721,36 @@ export default function farmRsc(options = {}) {
|
|
|
680
721
|
return middlewareConfigModules.get(id.replace(/\\/g, "/")) ?? null;
|
|
681
722
|
},
|
|
682
723
|
},
|
|
724
|
+
{
|
|
725
|
+
// Static opengraph-image and twitter-image files, as the RSC entry globs them: the info
|
|
726
|
+
// core's router reads (dimensions, content type, alt text, hash) and the bytes, which a
|
|
727
|
+
// build inlines as core's build does. farm dev reloads them when the image or its
|
|
728
|
+
// .alt.txt changes. The query is untrusted (a browser can send it to the dev server), so
|
|
729
|
+
// only the RSC environment, which imports these modules, reads a file, and only an image
|
|
730
|
+
// the entry's glob names: an opengraph-image or twitter-image under a route root.
|
|
731
|
+
name: "@farm.js/plugin/rsc:metadata-images",
|
|
732
|
+
enforce: "pre",
|
|
733
|
+
async load(id) {
|
|
734
|
+
const queryIndex = id.indexOf("?");
|
|
735
|
+
if (queryIndex === -1 ||
|
|
736
|
+
!new URLSearchParams(id.slice(queryIndex + 1)).has(FARM_METADATA_IMAGE_QUERY.slice(1))) {
|
|
737
|
+
return null;
|
|
738
|
+
}
|
|
739
|
+
const environmentName = this.environment?.name;
|
|
740
|
+
if (environmentName !== "rsc")
|
|
741
|
+
return null;
|
|
742
|
+
const file = path.resolve(id.slice(0, queryIndex));
|
|
743
|
+
if (!STATIC_METADATA_IMAGE_NAME.test(path.basename(file)) ||
|
|
744
|
+
!isFileInsideRoots(file, metadataImageRoots)) {
|
|
745
|
+
throw new Error(`[Farm.js] ${file} is not an opengraph-image or twitter-image file of the app's routes.`);
|
|
746
|
+
}
|
|
747
|
+
this.addWatchFile(file);
|
|
748
|
+
this.addWatchFile(path.join(path.dirname(file), `${path.basename(file, path.extname(file))}.alt.txt`));
|
|
749
|
+
const info = await inspectStaticMetadataImage(file);
|
|
750
|
+
const data = (await fs.readFile(file)).toString("base64");
|
|
751
|
+
return `export default ${JSON.stringify({ info, data })};`;
|
|
752
|
+
},
|
|
753
|
+
},
|
|
683
754
|
{
|
|
684
755
|
name: "@farm.js/plugin/rsc:core-runtime",
|
|
685
756
|
// Run after Vite/esbuild has lowered TS/JSX. es-module-lexer deliberately
|
|
@@ -850,6 +921,12 @@ export default function farmRsc(options = {}) {
|
|
|
850
921
|
// runtime cannot see from module exports: the same baked input core's server merges.
|
|
851
922
|
// Later roots override earlier ones, as the entry's merged page map does.
|
|
852
923
|
const pageRenderingDirectives = {};
|
|
924
|
+
// Core's default for an app without docs, as for llms.txt: the sitemap is on.
|
|
925
|
+
const sitemap = resolveFarmAgentSitemap(c.agent?.sitemap ?? true);
|
|
926
|
+
// Off by default, as in core: a generated robots.txt from agent.crawlers.
|
|
927
|
+
const crawlers = resolveFarmAgentCrawlers(c.agent?.crawlers);
|
|
928
|
+
// Each page file's last change, for the sitemap's lastmod, as core's build reads it.
|
|
929
|
+
const pageLastModified = {};
|
|
853
930
|
for (const source of getFarmSourceRoots(c)) {
|
|
854
931
|
const routesRoot = path.resolve(root, source.srcDir, configuredRoutesDir);
|
|
855
932
|
for (const { key, file } of await findRouteFiles(routesRoot, (name) => PAGE_FILE.test(name))) {
|
|
@@ -858,6 +935,57 @@ export default function farmRsc(options = {}) {
|
|
|
858
935
|
pageRenderingDirectives[key] = directive;
|
|
859
936
|
else
|
|
860
937
|
delete pageRenderingDirectives[key];
|
|
938
|
+
if (sitemap.enabled) {
|
|
939
|
+
const modified = await fs.stat(file).then((stat) => stat.mtime.toISOString(), () => undefined);
|
|
940
|
+
if (modified)
|
|
941
|
+
pageLastModified[key] = modified;
|
|
942
|
+
else
|
|
943
|
+
delete pageLastModified[key];
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
// sitemap.ts, robots.ts, manifest.ts, llms.ts and llms-full.ts route files, and
|
|
948
|
+
// opengraph-image and twitter-image files, as core serves them. A build bundles them only
|
|
949
|
+
// when the app has one; farm dev always looks, so a file added while it runs is served.
|
|
950
|
+
let appMetadataRoutes = env.command === "serve";
|
|
951
|
+
const metadataImages = { static: appMetadataRoutes, generated: appMetadataRoutes };
|
|
952
|
+
metadataImageRoots = [];
|
|
953
|
+
for (const source of getFarmSourceRoots(c)) {
|
|
954
|
+
const routesRoot = path.resolve(root, source.srcDir, configuredRoutesDir);
|
|
955
|
+
// Vite names a module by its real path, so the root's real path counts too.
|
|
956
|
+
metadataImageRoots.push(routesRoot, await fs.realpath(routesRoot).catch(() => routesRoot));
|
|
957
|
+
const files = await findRouteFiles(routesRoot, (name) => METADATA_ROUTE_FILE.test(name) || METADATA_IMAGE_FILE.test(name));
|
|
958
|
+
const images = new Map();
|
|
959
|
+
for (const { key, file } of files) {
|
|
960
|
+
const name = path.basename(file);
|
|
961
|
+
if (!METADATA_IMAGE_FILE.test(name)) {
|
|
962
|
+
appMetadataRoutes = true;
|
|
963
|
+
continue;
|
|
964
|
+
}
|
|
965
|
+
const isStatic = STATIC_METADATA_IMAGE_FILE.test(name);
|
|
966
|
+
if (isStatic)
|
|
967
|
+
metadataImages.static = true;
|
|
968
|
+
else
|
|
969
|
+
metadataImages.generated = true;
|
|
970
|
+
// A generated image renders with @vercel/og: a build without it fails, as core's does.
|
|
971
|
+
if (!isStatic &&
|
|
972
|
+
env.command === "build" &&
|
|
973
|
+
!isOptionalPeerInstalled(root, "@vercel/og")) {
|
|
974
|
+
throw new Error(`[Farm.js] ${path.relative(root, file).split(path.sep).join("/")} renders with @vercel/og, which is not installed. ${VERCEL_OG_INSTALL_HINT}`);
|
|
975
|
+
}
|
|
976
|
+
// One image of each kind per route segment (route groups add none), as core's
|
|
977
|
+
// router requires.
|
|
978
|
+
const fileName = name.slice(0, name.indexOf("."));
|
|
979
|
+
const pattern = key
|
|
980
|
+
.split("/")
|
|
981
|
+
.slice(0, -1)
|
|
982
|
+
.filter((segment) => !/^\(.+\)$/.test(segment))
|
|
983
|
+
.join("/") || "/";
|
|
984
|
+
const existing = images.get(`${fileName}:${pattern}`);
|
|
985
|
+
if (existing) {
|
|
986
|
+
throw new Error(`[Farm.js] Duplicate ${fileName} route "${pattern}". Found both ${existing} and ${file}. Keep only one static image or module per route segment.`);
|
|
987
|
+
}
|
|
988
|
+
images.set(`${fileName}:${pattern}`, file);
|
|
861
989
|
}
|
|
862
990
|
}
|
|
863
991
|
// Root layouts that render <html> own the document (Next.js's root layout contract).
|
|
@@ -891,6 +1019,29 @@ export default function farmRsc(options = {}) {
|
|
|
891
1019
|
if (env.command === "build" && mobileClient !== "entry") {
|
|
892
1020
|
removeFarmRscMobileClientManifest(root);
|
|
893
1021
|
}
|
|
1022
|
+
// Resolved the same way core resolves it for the config, so RSC and
|
|
1023
|
+
// non-RSC apps match middleware against the same pathname.
|
|
1024
|
+
const i18n = resolveFarmI18nConfig(c.i18n, {
|
|
1025
|
+
root,
|
|
1026
|
+
mode: env.command === "serve" ? "development" : "production",
|
|
1027
|
+
basePath: c.basePath ?? "/",
|
|
1028
|
+
});
|
|
1029
|
+
// The config redirects(), rewrites() and headers(), called once and checked as core's
|
|
1030
|
+
// config resolution checks them. An app without any generates the same entries as before.
|
|
1031
|
+
const configRoutes = await resolveRscConfigRoutes(c);
|
|
1032
|
+
const configRouteMatchers = configRoutes
|
|
1033
|
+
? createRscConfigRouteMatchers(configRoutes, { i18n, basePath: c.basePath ?? "/" })
|
|
1034
|
+
: undefined;
|
|
1035
|
+
devConfigRoutes = env.command === "serve" ? configRouteMatchers : undefined;
|
|
1036
|
+
// A build inlines the catalogs, read and validated as core's build reads them (a strict
|
|
1037
|
+
// mismatch fails the build), so the server needs no catalog files.
|
|
1038
|
+
let i18nCatalogs;
|
|
1039
|
+
if (i18n.enabled && env.command === "build") {
|
|
1040
|
+
const { createFarmI18nRuntime } = require_("@farm.js/core/i18n/server");
|
|
1041
|
+
const catalogRuntime = createFarmI18nRuntime(i18n);
|
|
1042
|
+
await catalogRuntime.initialize();
|
|
1043
|
+
i18nCatalogs = catalogRuntime.getCatalogs();
|
|
1044
|
+
}
|
|
894
1045
|
// Development always optimizes with Sharp, as core's dev server does.
|
|
895
1046
|
const imageRuntime = env.command === "serve"
|
|
896
1047
|
? imageConfig.provider === "none"
|
|
@@ -911,6 +1062,7 @@ export default function farmRsc(options = {}) {
|
|
|
911
1062
|
srcDir,
|
|
912
1063
|
outDir,
|
|
913
1064
|
basePath: c.basePath ?? "/",
|
|
1065
|
+
trailingSlash: c.trailingSlash === true,
|
|
914
1066
|
apiBasePath: resolveFarmAPIServerBasePath(api),
|
|
915
1067
|
routesDir: options.routesDir,
|
|
916
1068
|
globalCssPath,
|
|
@@ -925,13 +1077,14 @@ export default function farmRsc(options = {}) {
|
|
|
925
1077
|
markdown: resolveMarkdownConfig(c.md),
|
|
926
1078
|
// Core's default for an app without docs: llms.txt on, llms-full.txt off.
|
|
927
1079
|
llmsTxt: resolveFarmLlmsTxtConfig(c.agent?.llmsTxt ?? { full: false }),
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
}),
|
|
1080
|
+
sitemap,
|
|
1081
|
+
...(sitemap.enabled ? { pageLastModified } : {}),
|
|
1082
|
+
...(crawlers.enabled ? { crawlers } : {}),
|
|
1083
|
+
...(appMetadataRoutes ? { appMetadataRoutes } : {}),
|
|
1084
|
+
...(metadataImages.static || metadataImages.generated ? { metadataImages } : {}),
|
|
1085
|
+
i18n,
|
|
1086
|
+
...(i18nCatalogs ? { i18nCatalogs } : {}),
|
|
1087
|
+
...(configRoutes ? { configRoutes } : {}),
|
|
935
1088
|
server: { trustProxy: resolveFarmServerConfig(c.server).trustProxy },
|
|
936
1089
|
middlewareConfigPaths,
|
|
937
1090
|
pluginsConfigPaths,
|
|
@@ -1136,6 +1289,7 @@ export default function farmRsc(options = {}) {
|
|
|
1136
1289
|
"react-dom/client",
|
|
1137
1290
|
"rsc-html-stream/client",
|
|
1138
1291
|
...CLIENT_ENTRY_CORE_IMPORTS,
|
|
1292
|
+
...(i18n.enabled ? CLIENT_ENTRY_I18N_IMPORTS : []),
|
|
1139
1293
|
// Client components and the packages they use load only once a page renders
|
|
1140
1294
|
// (client references), so they would be found late too.
|
|
1141
1295
|
...clientOptimizeDeps.include,
|
|
@@ -1417,6 +1571,30 @@ if (document.readyState === 'loading') {
|
|
|
1417
1571
|
// Handles page rendering during development
|
|
1418
1572
|
// Middleware and API routes are handled by standalone plugins
|
|
1419
1573
|
// ────────────────────────────────────────────────────────
|
|
1574
|
+
{
|
|
1575
|
+
name: "@farm.js/plugin/rsc:config-routes",
|
|
1576
|
+
// Ahead of the API and middleware plugins and Vite's own middleware, as core's dev server
|
|
1577
|
+
// applies config routes before anything answers.
|
|
1578
|
+
configureServer: {
|
|
1579
|
+
order: "pre",
|
|
1580
|
+
handler(server) {
|
|
1581
|
+
if (!rscEnabled || !devConfigRoutes)
|
|
1582
|
+
return;
|
|
1583
|
+
server.middlewares.use(createRscConfigRoutesMiddleware({
|
|
1584
|
+
routes: () => devConfigRoutes,
|
|
1585
|
+
root: server.config.root,
|
|
1586
|
+
publicDir: server.config.publicDir,
|
|
1587
|
+
isApiPathname: (pathname) => isFarmAPIPathname(pathname, entryContext.apiBasePath) ||
|
|
1588
|
+
isFarmAPIPathname(pathname),
|
|
1589
|
+
hasLocalRoute: async (url) => {
|
|
1590
|
+
const entry = await loadRscDevEntry(server);
|
|
1591
|
+
return entry?.__farmHasLocalRequestRoute?.(url.href) === true;
|
|
1592
|
+
},
|
|
1593
|
+
bodySizeLimit,
|
|
1594
|
+
}));
|
|
1595
|
+
},
|
|
1596
|
+
},
|
|
1597
|
+
},
|
|
1420
1598
|
{
|
|
1421
1599
|
name: "@farm.js/plugin/rsc:dev-server",
|
|
1422
1600
|
configureServer(server) {
|
|
@@ -1515,25 +1693,7 @@ if (document.readyState === 'loading') {
|
|
|
1515
1693
|
? body.buffer.slice(body.byteOffset, body.byteOffset + body.byteLength)
|
|
1516
1694
|
: undefined,
|
|
1517
1695
|
});
|
|
1518
|
-
|
|
1519
|
-
// Never evaluate an RSC entry with SSR conditions or share its module cache.
|
|
1520
|
-
const rscEnv = server.environments.rsc;
|
|
1521
|
-
if (!rscEnv) {
|
|
1522
|
-
throw new FarmDevEnvironmentError('[Farm.js] The "rsc" development environment is missing. Enable @vitejs/plugin-rsc before serving RSC requests.');
|
|
1523
|
-
}
|
|
1524
|
-
let rscEntry = null;
|
|
1525
|
-
if (rscEnv) {
|
|
1526
|
-
const rscSource = rscEnv.config?.build?.rollupOptions?.input?.index ??
|
|
1527
|
-
"./.farm/rsc-entries/entry.rsc.tsx";
|
|
1528
|
-
const root = server.config.root;
|
|
1529
|
-
const importer = path.join(root, "vite.config.ts");
|
|
1530
|
-
const absoluteRscEntry = path.resolve(root, ".farm", "rsc-entries", "entry.rsc.tsx");
|
|
1531
|
-
const resolved = (await rscEnv.pluginContainer.resolveId(rscSource, importer)) ??
|
|
1532
|
-
(await rscEnv.pluginContainer.resolveId(rscSource)) ??
|
|
1533
|
-
(await rscEnv.pluginContainer.resolveId(absoluteRscEntry));
|
|
1534
|
-
const id = resolved?.id ?? pathToFileURL(absoluteRscEntry).href;
|
|
1535
|
-
rscEntry = await loadFarmDevModule(server, id, "rsc");
|
|
1536
|
-
}
|
|
1696
|
+
const rscEntry = await loadRscDevEntry(server);
|
|
1537
1697
|
if (!rscEntry?.default?.fetch)
|
|
1538
1698
|
throw new Error("[Farm.js] Could not load RSC entry in rsc environment");
|
|
1539
1699
|
const response = await rscEntry.default.fetch(request, {
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export declare function linkRscFixtureDependencies(root: string): void;
|
|
2
|
+
/** A 1x1 PNG for metadata image fixtures: core reads its size and hash as for any static image. */
|
|
3
|
+
export declare const METADATA_TEST_PNG: Buffer<ArrayBuffer>;
|
|
2
4
|
//# sourceMappingURL=test-fixture-dependencies.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-fixture-dependencies.d.ts","sourceRoot":"","sources":["../../src/rsc/test-fixture-dependencies.ts"],"names":[],"mappings":"AAaA,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAY7D"}
|
|
1
|
+
{"version":3,"file":"test-fixture-dependencies.d.ts","sourceRoot":"","sources":["../../src/rsc/test-fixture-dependencies.ts"],"names":[],"mappings":"AAaA,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAY7D;AAED,mGAAmG;AACnG,eAAO,MAAM,iBAAiB,qBAG7B,CAAC"}
|
|
@@ -21,3 +21,5 @@ export function linkRscFixtureDependencies(root) {
|
|
|
21
21
|
symlinkSync(realpathSync(source), target, process.platform === "win32" ? "junction" : "dir");
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
+
/** A 1x1 PNG for metadata image fixtures: core reads its size and hash as for any static image. */
|
|
25
|
+
export const METADATA_TEST_PNG = Buffer.from("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==", "base64");
|
package/dist/rsc/types.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { FarmMarkdownResolvedConfig } from "@farm.js/core/markdown";
|
|
2
|
-
import type { ResolvedFarmLlmsTxtConfig } from "@farm.js/core/internal/production-runtime";
|
|
3
|
-
import type { ResolvedFarmI18nConfig } from "@farm.js/core/i18n";
|
|
2
|
+
import type { ResolvedFarmAgentCrawlers, ResolvedFarmAgentSitemap, ResolvedFarmLlmsTxtConfig } from "@farm.js/core/internal/production-runtime";
|
|
3
|
+
import type { FarmI18nCatalogs, ResolvedFarmI18nConfig } from "@farm.js/core/i18n";
|
|
4
|
+
import type { createConfigRedirectMatcher } from "@farm.js/core/internal/production-runtime";
|
|
5
|
+
import type { createConfigHeadersMatcher } from "@farm.js/core/internal/production-runtime";
|
|
6
|
+
import type { createConfigRewriteMatcher } from "@farm.js/core/internal/production-runtime";
|
|
7
|
+
/** Core's config `redirects()`, `rewrites()` and `headers()` entries. */
|
|
8
|
+
export type RedirectConfig = Parameters<typeof createConfigRedirectMatcher>[0][number];
|
|
9
|
+
export type RewriteConfig = Parameters<typeof createConfigRewriteMatcher>[0][number];
|
|
10
|
+
export type HeaderConfig = Parameters<typeof createConfigHeadersMatcher>[0][number];
|
|
4
11
|
import type { FarmServerActionsConfig, ResolvedFarmServerActionsConfig } from "@farm.js/core/server-action-security";
|
|
5
12
|
/**
|
|
6
13
|
* Configuration options for the Farm.js RSC plugin.
|
|
@@ -96,6 +103,11 @@ export interface EntryContext {
|
|
|
96
103
|
outDir: string;
|
|
97
104
|
/** Base URL path, e.g. '/' */
|
|
98
105
|
basePath: string;
|
|
106
|
+
/**
|
|
107
|
+
* Core's `trailingSlash`: pages answer at `/about/` instead of `/about`, and `<Link>` renders
|
|
108
|
+
* that URL. Either way a page's other spelling redirects (308) to it.
|
|
109
|
+
*/
|
|
110
|
+
trailingSlash?: boolean;
|
|
99
111
|
/** Resolved same-origin mount for canonical /api routes. */
|
|
100
112
|
apiBasePath?: string;
|
|
101
113
|
/** Route files subdirectory within srcDir */
|
|
@@ -145,6 +157,21 @@ export interface EntryContext {
|
|
|
145
157
|
* matches a `/dashboard` middleware.
|
|
146
158
|
*/
|
|
147
159
|
i18n?: ResolvedFarmI18nConfig;
|
|
160
|
+
/**
|
|
161
|
+
* The i18n catalogs a build inlines, read and validated as core's build reads them, so the
|
|
162
|
+
* server needs no catalog files. Development reads them from disk instead.
|
|
163
|
+
*/
|
|
164
|
+
i18nCatalogs?: FarmI18nCatalogs;
|
|
165
|
+
/**
|
|
166
|
+
* The config `redirects()`, `rewrites()` and `headers()`, resolved once as core resolves them.
|
|
167
|
+
* Set only when one of them has an entry, and applied by the production server; the dev server
|
|
168
|
+
* applies them ahead of Vite and the API routes, as core's does.
|
|
169
|
+
*/
|
|
170
|
+
configRoutes?: {
|
|
171
|
+
redirects: RedirectConfig[];
|
|
172
|
+
rewrites: RewriteConfig[];
|
|
173
|
+
headers: HeaderConfig[];
|
|
174
|
+
};
|
|
148
175
|
/**
|
|
149
176
|
* Server settings the request path needs. `trustProxy` decides whether
|
|
150
177
|
* forwarded headers are believed when middleware reads the client address.
|
|
@@ -166,6 +193,27 @@ export interface EntryContext {
|
|
|
166
193
|
markdown?: FarmMarkdownResolvedConfig;
|
|
167
194
|
/** Resolved `agent.llmsTxt`: the generated `/llms.txt` and `/llms-full.txt`. */
|
|
168
195
|
llmsTxt?: ResolvedFarmLlmsTxtConfig;
|
|
196
|
+
/** Resolved `agent.sitemap`: the generated `/sitemap.xml`. */
|
|
197
|
+
sitemap?: ResolvedFarmAgentSitemap;
|
|
198
|
+
/** Route-relative page keys to their file's last change (ISO), the sitemap's lastmod. */
|
|
199
|
+
pageLastModified?: Record<string, string>;
|
|
200
|
+
/** Resolved `agent.crawlers`: the generated `/robots.txt`, set only when it is on. */
|
|
201
|
+
crawlers?: ResolvedFarmAgentCrawlers;
|
|
202
|
+
/**
|
|
203
|
+
* Serve `sitemap.ts`, `robots.ts`, `manifest.ts`, `llms.ts` and `llms-full.ts` route files, as
|
|
204
|
+
* core does: set when the app has one, and always in development so a new file is picked up.
|
|
205
|
+
*/
|
|
206
|
+
appMetadataRoutes?: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* Serve `opengraph-image` and `twitter-image` files (static images and generated modules) and
|
|
209
|
+
* add the nearest one to the page head, as core does. `static` covers image files (`.png`,
|
|
210
|
+
* `.jpg`, `.jpeg`, `.gif`, `.webp`) and `generated` modules rendered with `@vercel/og`; each is
|
|
211
|
+
* set when the app has one, and both always in development so a new file is picked up.
|
|
212
|
+
*/
|
|
213
|
+
metadataImages?: {
|
|
214
|
+
static: boolean;
|
|
215
|
+
generated: boolean;
|
|
216
|
+
};
|
|
169
217
|
/** Whether debug mode is enabled */
|
|
170
218
|
debug: boolean;
|
|
171
219
|
/** True only for the Vite serve command, never for a production build. */
|
|
@@ -199,11 +247,12 @@ export interface RscPayload {
|
|
|
199
247
|
root: React.ReactElement;
|
|
200
248
|
/** Content for div#root only (for client hydration to avoid double/repeated content) */
|
|
201
249
|
rootContent?: React.ReactElement;
|
|
202
|
-
/**
|
|
250
|
+
/** The document title, which client-side navigation sets. */
|
|
203
251
|
metadata?: {
|
|
204
252
|
title?: string;
|
|
205
|
-
description?: string;
|
|
206
253
|
};
|
|
254
|
+
/** The head tags rendered from the route's metadata, which client-side navigation swaps in. */
|
|
255
|
+
metadataHead?: string;
|
|
207
256
|
/** Server action return value (if action was executed) */
|
|
208
257
|
returnValue?: {
|
|
209
258
|
ok: boolean;
|
package/dist/rsc/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/rsc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/rsc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAC5F,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAE5F,yEAAyE;AACzE,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACvF,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACrF,MAA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
"description": "Official plugins for Farm.js framework",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Farm.js Team",
|
|
@@ -58,12 +58,12 @@
|
|
|
58
58
|
"@farming-labs/strata": "0.1.2",
|
|
59
59
|
"better-call": "^1.0.19",
|
|
60
60
|
"es-module-lexer": "2.0.0",
|
|
61
|
-
"h3": "2.0.
|
|
61
|
+
"h3": "2.0.8",
|
|
62
62
|
"nf3": "0.3.24",
|
|
63
63
|
"nitro": "3.0.260903-beta",
|
|
64
64
|
"picocolors": "^1.0.0",
|
|
65
65
|
"rsc-html-stream": "^0.0.4",
|
|
66
|
-
"@farm.js/core": "0.1.
|
|
66
|
+
"@farm.js/core": "0.1.70"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/node": "^22.20.5",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"react-dom": "19.2.8",
|
|
85
85
|
"react-server-dom-webpack": "19.2.8",
|
|
86
86
|
"vite": ">=6.0.0",
|
|
87
|
-
"@farm.js/core": "0.1.
|
|
87
|
+
"@farm.js/core": "0.1.70"
|
|
88
88
|
},
|
|
89
89
|
"peerDependenciesMeta": {
|
|
90
90
|
"@vitejs/plugin-rsc": {
|