@farm.js/core 0.1.63 → 0.1.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp-handler-OV4WRFBL.cjs → agent-mcp-handler-OXT73ZBY.cjs} +5 -5
- package/dist/{agent-mcp-handler-7QMX2LUY.mjs → agent-mcp-handler-QLFDDTYN.mjs} +4 -4
- package/dist/{agent-mcp.d-CCQ-wKwg.d.mts → agent-mcp.d-CO_ABmNK.d.mts} +1 -1
- package/dist/{agent-mcp.d-DOJCBSh9.d.ts → agent-mcp.d-QD2WZ9BS.d.ts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/analyzer-ODLF2Z6O.cjs +16 -0
- package/dist/{analyzer-WNPQPWFR.mjs → analyzer-Q3QXC6PD.mjs} +3 -2
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.d.mts +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/{app-manifest.d-BaA0omsv.d.mts → app-manifest.d-BpKxiU_E.d.mts} +1 -1
- package/dist/{app-manifest.d-poayV4lq.d.ts → app-manifest.d-DDmNkYQQ.d.ts} +1 -1
- package/dist/app-markdown.cjs +4 -4
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/app-markdown.mjs +3 -3
- package/dist/{app.d-DdWxeIGU.d.mts → app.d-kuoVWhWM.d.mts} +4 -4
- package/dist/{app.d-D4Dn03E3.d.ts → app.d-x68Cwr0_.d.ts} +4 -4
- package/dist/{chunk-LT4VAF5Z.cjs → chunk-2C5L5RPM.cjs} +7 -6
- package/dist/{chunk-PVJX4UPA.cjs → chunk-3EBHJET2.cjs} +103 -98
- package/dist/{chunk-4DIKLG56.mjs → chunk-6NHSGVVA.mjs} +1 -1
- package/dist/{chunk-S2NUYHRY.mjs → chunk-6NNYPY5W.mjs} +327 -13
- package/dist/{chunk-PRFNLQSP.cjs → chunk-7XGWBPQQ.cjs} +4 -4
- package/dist/{chunk-U6WCUVSV.cjs → chunk-DUSHDZQL.cjs} +9 -9
- package/dist/{chunk-GVOMPU3Y.cjs → chunk-EL4364S2.cjs} +209 -32
- package/dist/{chunk-QN5WRQSQ.cjs → chunk-FAP7CX7C.cjs} +101 -101
- package/dist/{chunk-GPKBUME5.mjs → chunk-FH45OB37.mjs} +2 -2
- package/dist/{chunk-55U5QIXQ.mjs → chunk-FIR62CR3.mjs} +1 -1
- package/dist/{chunk-MEQN6DDA.cjs → chunk-FJWN7RV4.cjs} +5 -5
- package/dist/chunk-IOEXXZK3.mjs +88 -0
- package/dist/{chunk-Z74NNER4.cjs → chunk-JCPSA4X5.cjs} +135 -134
- package/dist/{chunk-YSXTNSXS.mjs → chunk-K7OZAVOI.mjs} +7 -6
- package/dist/{chunk-KVW2M6PI.mjs → chunk-KL7SHLQB.mjs} +1 -1
- package/dist/{chunk-RFYL5OLP.mjs → chunk-LQDLEWPO.mjs} +1 -1
- package/dist/{chunk-UZZ6IEQP.mjs → chunk-MESQF2JC.mjs} +2 -2
- package/dist/{chunk-5L7I6AMY.cjs → chunk-MG356ROI.cjs} +5 -5
- package/dist/{chunk-Y2YBNQ3D.cjs → chunk-N3Z3PLHC.cjs} +2 -2
- package/dist/{chunk-XICXQXYE.mjs → chunk-NNLFW3P4.mjs} +2 -2
- package/dist/{chunk-EYLC6GD6.cjs → chunk-NXFA7G3Y.cjs} +12 -12
- package/dist/{chunk-FNHN3RBD.cjs → chunk-O2XFIPNL.cjs} +1 -1
- package/dist/{chunk-BA2IA32Q.mjs → chunk-O4FWNLQK.mjs} +3 -3
- package/dist/{chunk-DZPR2W6U.cjs → chunk-O6L3YYPM.cjs} +5 -5
- package/dist/{chunk-LFFSDZ4Y.cjs → chunk-O7IEMY55.cjs} +3 -3
- package/dist/{chunk-6BJJYOFL.cjs → chunk-OLIGNTWU.cjs} +7 -7
- package/dist/{chunk-EENTT56C.mjs → chunk-OYF23QLG.mjs} +15 -14
- package/dist/{chunk-CBDRR3J3.mjs → chunk-RAH5MT53.mjs} +19 -14
- package/dist/{chunk-E72UD6ME.mjs → chunk-RVGSVQWT.mjs} +1 -1
- package/dist/{chunk-5IKQ7BIR.cjs → chunk-S25BQIFW.cjs} +16 -16
- package/dist/{chunk-LWWDTBGL.cjs → chunk-S7ZW72JH.cjs} +2 -2
- package/dist/{chunk-7FFW7DC4.mjs → chunk-SLYDIHLW.mjs} +4 -4
- package/dist/{chunk-LA6O5EL2.mjs → chunk-SNFTMSHX.mjs} +1 -1
- package/dist/{chunk-PCXIJKPM.mjs → chunk-TNBJ4LZG.mjs} +2 -2
- package/dist/{chunk-O27PLNQZ.cjs → chunk-UJ3R2AH2.cjs} +4 -4
- package/dist/{chunk-T4TBK5NY.mjs → chunk-VQ4NWOWO.mjs} +2 -2
- package/dist/{chunk-ZZ2QKCKW.mjs → chunk-WAY6LOQH.mjs} +1 -1
- package/dist/chunk-WBTHHTBO.cjs +88 -0
- package/dist/{chunk-O5FCWI6O.mjs → chunk-WFNAOWH4.mjs} +1 -1
- package/dist/{chunk-IWRLV46X.cjs → chunk-WMTBBQHY.cjs} +4 -4
- package/dist/{chunk-LA45FN37.mjs → chunk-WNYRYI4D.mjs} +10 -10
- package/dist/{chunk-CI4UNQHO.cjs → chunk-XBSKPLHF.cjs} +2 -2
- package/dist/{chunk-IOF4KXMP.mjs → chunk-XVWSDSUM.mjs} +201 -24
- package/dist/{chunk-ANXU3D32.cjs → chunk-XZLZ6YPP.cjs} +346 -32
- package/dist/{chunk-QAS7KE7J.cjs → chunk-Y5TOT5F6.cjs} +5 -5
- package/dist/{chunk-DPE53XWL.mjs → chunk-ZEXE4TGY.mjs} +1 -1
- package/dist/{client-component.d-CSEFlHfG.d.mts → client-component.d-D74pqdea.d.mts} +2 -2
- package/dist/{client-component.d-CQLvqLAJ.d.ts → client-component.d-D8VcypQA.d.ts} +2 -2
- package/dist/{client-plugins.d-BgPUYPc9.d.ts → client-plugins.d-CXElzotB.d.ts} +8 -1
- package/dist/{client-plugins.d-BTF0gZm4.d.mts → client-plugins.d-D4-6hNx7.d.mts} +8 -1
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.d.mts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-HDKTYIZF.mjs → devtools-MX3FE733.mjs} +4 -4
- package/dist/{devtools-ZHN5JLVI.cjs → devtools-WET5NAKO.cjs} +5 -5
- package/dist/docs.cjs +7 -7
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +6 -6
- package/dist/index.cjs +20 -19
- package/dist/{index.d-Coow7bD4.d.ts → index.d-A_x10zGS.d.ts} +1 -1
- package/dist/{index.d-Dbjx0ku7.d.mts → index.d-SSgYDv4D.d.mts} +1 -1
- package/dist/index.d.mts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.mjs +19 -18
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.cjs +3 -3
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/app-markdown-runtime.mjs +2 -2
- package/dist/internal/build-runtime.cjs +21 -20
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +20 -19
- package/dist/internal/cli-runtime.cjs +6 -6
- package/dist/internal/cli-runtime.mjs +5 -5
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +4 -4
- package/dist/internal/client-runtime.d.ts +4 -4
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +6 -6
- package/dist/internal/config-runtime.d.mts +4 -4
- package/dist/internal/config-runtime.d.ts +4 -4
- package/dist/internal/config-runtime.mjs +5 -5
- package/dist/internal/infra-analytics-runtime.cjs +9 -9
- package/dist/internal/infra-analytics-runtime.mjs +7 -7
- package/dist/internal/native-server-fns.cjs +5 -4
- package/dist/internal/native-server-fns.mjs +4 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +11 -11
- package/dist/internal/production-runtime.d.mts +13 -12
- package/dist/internal/production-runtime.d.ts +13 -12
- package/dist/internal/production-runtime.mjs +10 -10
- package/dist/markdown.cjs +2 -2
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +1 -1
- package/dist/middleware.d.mts +3 -3
- package/dist/middleware.d.ts +3 -3
- package/dist/mobile.d.mts +2 -2
- package/dist/mobile.d.ts +2 -2
- package/dist/{native-tree-AS5L3ID3.mjs → native-tree-BPEE2LAL.mjs} +2 -2
- package/dist/{native-tree-Z2WYUJEV.cjs → native-tree-WOX3JMBG.cjs} +3 -3
- package/dist/{navigation-delegate.d-Ca_BV0Wu.d.mts → navigation-delegate.d-DQVYKoaZ.d.mts} +1 -1
- package/dist/{navigation-delegate.d-aHiPI6GL.d.ts → navigation-delegate.d-GghbHJuK.d.ts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/plugin.cjs +13 -13
- package/dist/plugin.d.mts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.mjs +12 -12
- package/dist/{production-runtime.d-C0rF7a10.d.ts → production-runtime.d-Bzns3NW9.d.ts} +1 -1
- package/dist/{production-runtime.d-CnAsSWgF.d.mts → production-runtime.d-DiFa5vHW.d.mts} +1 -1
- package/dist/{render-plan.d-BxeITFT1.d.ts → render-plan.d-CL_Ikfg_.d.ts} +1 -1
- package/dist/{render-plan.d-Z-93m5GZ.d.mts → render-plan.d-CcF0MeCf.d.mts} +1 -1
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/{request.d-X7Q1vmGF.d.ts → request.d-B1RnTLri.d.ts} +1 -1
- package/dist/{request.d-8_fMFNEb.d.mts → request.d-DarDOCk9.d.mts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-BUr3Jp8S.d.ts → route-rendering.d-BTUYCIj4.d.ts} +1 -1
- package/dist/{route-rendering.d-BInmBmul.d.mts → route-rendering.d-D_2Ual0-.d.mts} +1 -1
- package/dist/{router.d-crorSRiW.d.ts → router.d-CMANF6da.d.ts} +1 -1
- package/dist/{router.d-CZQmbpHx.d.mts → router.d-Cuv1jntg.d.mts} +1 -1
- package/dist/{routes.d-BknKQcTu.d.ts → routes.d-B6yFe6jm.d.ts} +1 -1
- package/dist/{routes.d-D1IrO9KK.d.mts → routes.d-c2HKfrfL.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-3MPRULGA.mjs → rsc-pipeline-3LNVP2OO.mjs} +5 -5
- package/dist/{rsc-pipeline-RHEZNBFQ.cjs → rsc-pipeline-G5WELVW3.cjs} +6 -6
- package/dist/{runtime-OZKFZQCU.cjs → runtime-DMEULPE7.cjs} +21 -10
- package/dist/{runtime-X5UR7VHP.mjs → runtime-HQJ2LLQL.mjs} +19 -8
- package/dist/{runtime.d-CCsjTZJW.d.ts → runtime.d-C3RQUj6_.d.ts} +1 -1
- package/dist/{runtime.d-CETtpLb-.d.mts → runtime.d-wvh4ngU0.d.mts} +1 -1
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server.cjs +30 -30
- package/dist/server.d.mts +9 -9
- package/dist/server.d.ts +9 -9
- package/dist/server.mjs +15 -15
- package/dist/{spa-router.d-CtSHzXlC.d.mts → spa-router.d-WU_qS5gJ.d.mts} +2 -2
- package/dist/{spa-router.d-CCADbSqJ.d.ts → spa-router.d-m8H_Kl_B.d.ts} +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{utils.d-CjyE-npA.d.ts → utils.d-C9dQD5Zg.d.ts} +1 -1
- package/dist/{utils.d-zFPHKFFJ.d.mts → utils.d-W9IiEqmW.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +13 -13
- package/dist/vite.d.mts +4 -4
- package/dist/vite.d.ts +4 -4
- package/dist/vite.mjs +12 -12
- package/package.json +1 -1
- package/dist/analyzer-KEA5JVDR.cjs +0 -15
|
@@ -1,21 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
farmComponentKind,
|
|
3
|
+
farmComponentModuleScripts,
|
|
4
|
+
keepFarmComponentRanges,
|
|
5
|
+
readFarmComponentBlocks
|
|
6
|
+
} from "./chunk-IOEXXZK3.mjs";
|
|
1
7
|
import {
|
|
2
8
|
FARM_NATIVE_STYLE_PROPERTIES,
|
|
3
9
|
FARM_NATIVE_TEXT_KEYS,
|
|
4
10
|
farmNativeClassProblem,
|
|
5
11
|
inspectFarmNativeStylesheets,
|
|
6
12
|
parseFarmNativeStylesheet,
|
|
7
|
-
resolveFarmNativeClasses
|
|
13
|
+
resolveFarmNativeClasses,
|
|
14
|
+
resolveFarmNativeInlineStyle
|
|
8
15
|
} from "./chunk-JCEFKP5M.mjs";
|
|
9
16
|
import {
|
|
10
17
|
FARM_VERSION
|
|
11
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-LQDLEWPO.mjs";
|
|
12
19
|
|
|
13
20
|
// src/mobile/analyzer.ts
|
|
14
21
|
import { createHash } from "crypto";
|
|
15
22
|
import { existsSync, readFileSync, statSync } from "fs";
|
|
16
23
|
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
17
24
|
import * as path from "path";
|
|
18
|
-
var ANALYZER_VERSION = `
|
|
25
|
+
var ANALYZER_VERSION = `6:${FARM_VERSION}`;
|
|
19
26
|
var INTRINSIC_KINDS = {};
|
|
20
27
|
for (const tag of "div section main article header footer nav aside figure hr li".split(" ")) {
|
|
21
28
|
INTRINSIC_KINDS[tag] = "View";
|
|
@@ -29,6 +36,8 @@ Object.assign(INTRINSIC_KINDS, {
|
|
|
29
36
|
a: "Pressable",
|
|
30
37
|
input: "TextInput",
|
|
31
38
|
textarea: "TextInput",
|
|
39
|
+
// Native-tier screens submit forms as a browser would (native-tree.ts).
|
|
40
|
+
form: "View",
|
|
32
41
|
ul: "List",
|
|
33
42
|
ol: "List"
|
|
34
43
|
});
|
|
@@ -162,6 +171,8 @@ var MAPPED_COMPONENTS = {
|
|
|
162
171
|
};
|
|
163
172
|
var SERVER_FN_FACTORIES = /* @__PURE__ */ new Set(["createServerFn", "createServerQuery"]);
|
|
164
173
|
var SCRIPT_EXTENSIONS = [".tsx", ".ts", ".jsx", ".js", ".mjs"];
|
|
174
|
+
var COMPONENT_EXTENSIONS = [".vue", ".svelte"];
|
|
175
|
+
var isModuleFile = (file) => [...SCRIPT_EXTENSIONS, ...COMPONENT_EXTENSIONS].some((extension) => file.endsWith(extension));
|
|
165
176
|
var STYLE_FILE = /\.(?:css|scss|sass|less|styl|stylus|pcss|postcss)(?:\?.*)?$/i;
|
|
166
177
|
var ASSET_FILE = /\.(?:png|jpe?g|gif|webp|avif|svg|ico|bmp|json|woff2?|ttf|otf|mp3|wav|txt)(?:\?.*)?$/i;
|
|
167
178
|
var STYLE_PROPERTIES = new Set(
|
|
@@ -310,7 +321,7 @@ var SKIP_KEYS = /* @__PURE__ */ new Set([
|
|
|
310
321
|
"typeArguments",
|
|
311
322
|
"decorators"
|
|
312
323
|
]);
|
|
313
|
-
function analyzeSource(file, source, parseSync) {
|
|
324
|
+
function analyzeSource(file, source, parseSync, lang = scriptLang(file)) {
|
|
314
325
|
const facts = {
|
|
315
326
|
imports: [],
|
|
316
327
|
blockers: [],
|
|
@@ -333,7 +344,8 @@ function analyzeSource(file, source, parseSync) {
|
|
|
333
344
|
});
|
|
334
345
|
};
|
|
335
346
|
const needsDevice = (node, message) => block(node, "client-logic", message, "native");
|
|
336
|
-
|
|
347
|
+
let formDepth = 0;
|
|
348
|
+
const result = parseSync(file, source, { lang });
|
|
337
349
|
if (result.errors.length > 0) {
|
|
338
350
|
const error = result.errors[0];
|
|
339
351
|
const offset = error.labels?.[0]?.start ?? 0;
|
|
@@ -464,6 +476,7 @@ function analyzeSource(file, source, parseSync) {
|
|
|
464
476
|
const props = {};
|
|
465
477
|
const style = [];
|
|
466
478
|
const events = [];
|
|
479
|
+
let submits = false;
|
|
467
480
|
for (const attribute of opening.attributes) {
|
|
468
481
|
if (attribute.type === "JSXSpreadAttribute") {
|
|
469
482
|
if (isIntrinsic)
|
|
@@ -486,7 +499,10 @@ function analyzeSource(file, source, parseSync) {
|
|
|
486
499
|
continue;
|
|
487
500
|
}
|
|
488
501
|
if ((name === "action" || name === "formAction") && isIntrinsic) {
|
|
489
|
-
|
|
502
|
+
if (staticString(value) === void 0) {
|
|
503
|
+
block(attribute, "form-action", `${name} on <${tag}>`);
|
|
504
|
+
}
|
|
505
|
+
submits = true;
|
|
490
506
|
continue;
|
|
491
507
|
}
|
|
492
508
|
if (/^on[A-Z]/.test(name)) {
|
|
@@ -560,7 +576,8 @@ function analyzeSource(file, source, parseSync) {
|
|
|
560
576
|
}
|
|
561
577
|
if (tag === "input" && name === "type") {
|
|
562
578
|
const type = staticString(value);
|
|
563
|
-
|
|
579
|
+
const formType = formDepth > 0 && (type === "hidden" || type === "submit");
|
|
580
|
+
if (!formType && (type === void 0 || !INPUT_TYPES.has(type))) {
|
|
564
581
|
block(
|
|
565
582
|
attribute,
|
|
566
583
|
"unmapped-element",
|
|
@@ -577,6 +594,22 @@ function analyzeSource(file, source, parseSync) {
|
|
|
577
594
|
if (kind === "TextInput" && events.some((event) => event === "onChange" || event === "onInput")) {
|
|
578
595
|
wins.add("input");
|
|
579
596
|
}
|
|
597
|
+
const inForm = formDepth > 0;
|
|
598
|
+
const buttonType = tag === "button" ? props.type ?? "submit" : void 0;
|
|
599
|
+
if (isIntrinsic && (tag === "button" || kind === "TextInput") && events.length === 0 && !submits && props.type !== "hidden" && (!inForm || buttonType !== void 0 && buttonType !== "submit")) {
|
|
600
|
+
block(
|
|
601
|
+
opening,
|
|
602
|
+
"inert-control",
|
|
603
|
+
inForm ? `<button type="${String(buttonType)}"> does nothing on a native-tier screen` : `<${tag}> has no link or form to submit on a native-tier screen`,
|
|
604
|
+
"native"
|
|
605
|
+
);
|
|
606
|
+
}
|
|
607
|
+
if (isIntrinsic && tag === "form") {
|
|
608
|
+
const method = typeof props.method === "string" ? props.method.toLowerCase() : "get";
|
|
609
|
+
if (props.method === "{expr}" || method !== "get" && method !== "post") {
|
|
610
|
+
block(opening, "form-action", `<form method="${String(props.method)}">`, "native");
|
|
611
|
+
}
|
|
612
|
+
}
|
|
580
613
|
if (Object.keys(props).length > 0) node.props = props;
|
|
581
614
|
if (style.length > 0) node.style = style;
|
|
582
615
|
if (events.length > 0) node.events = events;
|
|
@@ -604,7 +637,10 @@ function analyzeSource(file, source, parseSync) {
|
|
|
604
637
|
for (const attribute of node.openingElement.attributes) {
|
|
605
638
|
visit(attribute.type === "JSXSpreadAttribute" ? attribute.argument : attribute.value);
|
|
606
639
|
}
|
|
640
|
+
const form = ui.tag === "form";
|
|
641
|
+
if (form) formDepth += 1;
|
|
607
642
|
visitChildren(node.children, ui);
|
|
643
|
+
if (form) formDepth -= 1;
|
|
608
644
|
append(parent, ui);
|
|
609
645
|
return ui;
|
|
610
646
|
}
|
|
@@ -780,6 +816,278 @@ function analyzeSource(file, source, parseSync) {
|
|
|
780
816
|
facts.blockers.sort((left, right) => left.line - right.line || left.column - right.column);
|
|
781
817
|
return facts;
|
|
782
818
|
}
|
|
819
|
+
var COMPONENT_STRUCTURE = /* @__PURE__ */ new Set([
|
|
820
|
+
"template",
|
|
821
|
+
"slot",
|
|
822
|
+
"Transition",
|
|
823
|
+
"TransitionGroup",
|
|
824
|
+
"KeepAlive",
|
|
825
|
+
"Suspense",
|
|
826
|
+
"svelte:head",
|
|
827
|
+
"svelte:fragment",
|
|
828
|
+
"svelte:options",
|
|
829
|
+
"svelte:window",
|
|
830
|
+
"svelte:body",
|
|
831
|
+
"svelte:document",
|
|
832
|
+
"svelte:boundary"
|
|
833
|
+
]);
|
|
834
|
+
var COMPONENT_DYNAMIC = /* @__PURE__ */ new Set(["component", "svelte:element", "svelte:component", "Teleport"]);
|
|
835
|
+
var VOID_ELEMENTS = new Set(
|
|
836
|
+
"area base br col embed hr img input link meta source track wbr".split(" ")
|
|
837
|
+
);
|
|
838
|
+
function analyzeComponentSource(file, source, parseSync) {
|
|
839
|
+
const blocks = readFarmComponentBlocks(file, source);
|
|
840
|
+
const name = blocks.kind === "vue" ? "Vue" : "Svelte";
|
|
841
|
+
const scripts = keepFarmComponentRanges(source, blocks.scripts);
|
|
842
|
+
const typed = blocks.scripts.some((script) => script.attributes.lang === "tsx") ? "tsx" : "ts";
|
|
843
|
+
const facts = analyzeSource(file, scripts, parseSync, typed);
|
|
844
|
+
facts.blockers = facts.blockers.filter((blocker) => blocker.rule !== "client-logic");
|
|
845
|
+
const starts = lineStarts(source);
|
|
846
|
+
const block = (offset, rule, message, only) => facts.blockers.push({ ...locate(starts, offset), rule, message, ...only ? { only } : {} });
|
|
847
|
+
facts.blockers.push({
|
|
848
|
+
line: 1,
|
|
849
|
+
column: 1,
|
|
850
|
+
rule: "renderer-component",
|
|
851
|
+
message: `a ${name} component has no React Native port`,
|
|
852
|
+
only: "react-native"
|
|
853
|
+
});
|
|
854
|
+
for (const script of farmComponentModuleScripts(blocks)) {
|
|
855
|
+
const hydrate = /\bexport\s+const\s+hydrate\s*=\s*true\b/.exec(
|
|
856
|
+
source.slice(script.start, script.end)
|
|
857
|
+
);
|
|
858
|
+
if (hydrate) {
|
|
859
|
+
block(
|
|
860
|
+
script.start + hydrate.index,
|
|
861
|
+
"client-logic",
|
|
862
|
+
"it exports hydrate = true, which hydrates the page in the browser",
|
|
863
|
+
"native"
|
|
864
|
+
);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
const styles = blocks.styles.filter((style) => !style.attributes.lang || style.attributes.lang === "css").map((style) => source.slice(style.start, style.end));
|
|
868
|
+
if (styles.length > 0) facts.styles = styles;
|
|
869
|
+
for (const style of blocks.styles) {
|
|
870
|
+
if (style.attributes.lang && style.attributes.lang !== "css") {
|
|
871
|
+
block(
|
|
872
|
+
style.start,
|
|
873
|
+
"css-import",
|
|
874
|
+
`<style lang="${String(style.attributes.lang)}"> is not CSS`
|
|
875
|
+
);
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
const imported = /* @__PURE__ */ new Set();
|
|
879
|
+
for (const script of blocks.scripts) {
|
|
880
|
+
const text = source.slice(script.start, script.end);
|
|
881
|
+
for (const match of text.matchAll(/\bimport\s+(?:type\s+)?([\w$]+)\s*(?:,|from\b)/g)) {
|
|
882
|
+
imported.add(match[1]);
|
|
883
|
+
}
|
|
884
|
+
for (const match of text.matchAll(/\bimport\s+(?:[\w$]+\s*,\s*)?\{([^}]*)\}/g)) {
|
|
885
|
+
for (const part of match[1].split(",")) {
|
|
886
|
+
const local = part.trim().split(/\s+as\s+/).pop()?.trim();
|
|
887
|
+
if (local) imported.add(local);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
const pascal = (tag) => tag.replace(/(^|-)([a-z])/g, (_, __, letter) => letter.toUpperCase());
|
|
892
|
+
let formDepth = 0;
|
|
893
|
+
const open = [];
|
|
894
|
+
for (const range of blocks.markup) {
|
|
895
|
+
const markup = source.slice(range.start, range.end);
|
|
896
|
+
let index = 0;
|
|
897
|
+
while (index < markup.length) {
|
|
898
|
+
const at = range.start + index;
|
|
899
|
+
if (markup.startsWith("<!--", index)) {
|
|
900
|
+
const end = markup.indexOf("-->", index + 4);
|
|
901
|
+
index = end === -1 ? markup.length : end + 3;
|
|
902
|
+
continue;
|
|
903
|
+
}
|
|
904
|
+
if (markup[index] === "{") {
|
|
905
|
+
const end = closeBrace(markup, index);
|
|
906
|
+
if (blocks.kind === "svelte" && /^\{@html\b/.test(markup.slice(index))) {
|
|
907
|
+
block(at, "dangerously-set-inner-html", "{@html} renders raw HTML");
|
|
908
|
+
}
|
|
909
|
+
index = end;
|
|
910
|
+
continue;
|
|
911
|
+
}
|
|
912
|
+
if (markup[index] !== "<") {
|
|
913
|
+
index += 1;
|
|
914
|
+
continue;
|
|
915
|
+
}
|
|
916
|
+
const closing = markup[index + 1] === "/";
|
|
917
|
+
const nameMatch = /^[A-Za-z][\w:.-]*/.exec(markup.slice(index + (closing ? 2 : 1)));
|
|
918
|
+
if (!nameMatch) {
|
|
919
|
+
index += 1;
|
|
920
|
+
continue;
|
|
921
|
+
}
|
|
922
|
+
const tag = nameMatch[0];
|
|
923
|
+
let cursor = index + (closing ? 2 : 1) + tag.length;
|
|
924
|
+
const attributes = [];
|
|
925
|
+
let selfClosing = false;
|
|
926
|
+
while (cursor < markup.length && markup[cursor] !== ">") {
|
|
927
|
+
const char = markup[cursor];
|
|
928
|
+
if (/\s/.test(char)) {
|
|
929
|
+
cursor += 1;
|
|
930
|
+
continue;
|
|
931
|
+
}
|
|
932
|
+
if (char === "/" && markup[cursor + 1] === ">") {
|
|
933
|
+
selfClosing = true;
|
|
934
|
+
cursor += 1;
|
|
935
|
+
continue;
|
|
936
|
+
}
|
|
937
|
+
if (char === "{") {
|
|
938
|
+
attributes.push({ name: "{", dynamic: true, offset: range.start + cursor });
|
|
939
|
+
cursor = closeBrace(markup, cursor);
|
|
940
|
+
continue;
|
|
941
|
+
}
|
|
942
|
+
const attrName = /^[^\s=/>]+/.exec(markup.slice(cursor))?.[0] ?? char;
|
|
943
|
+
const attrOffset = range.start + cursor;
|
|
944
|
+
cursor += attrName.length;
|
|
945
|
+
while (/\s/.test(markup[cursor] ?? "")) cursor += 1;
|
|
946
|
+
let value2;
|
|
947
|
+
let braced = false;
|
|
948
|
+
if (markup[cursor] === "=") {
|
|
949
|
+
cursor += 1;
|
|
950
|
+
while (/\s/.test(markup[cursor] ?? "")) cursor += 1;
|
|
951
|
+
const quote = markup[cursor];
|
|
952
|
+
if (quote === '"' || quote === "'") {
|
|
953
|
+
const end = markup.indexOf(quote, cursor + 1);
|
|
954
|
+
value2 = markup.slice(cursor + 1, end === -1 ? markup.length : end);
|
|
955
|
+
cursor = end === -1 ? markup.length : end + 1;
|
|
956
|
+
} else if (quote === "{") {
|
|
957
|
+
const end = closeBrace(markup, cursor);
|
|
958
|
+
value2 = markup.slice(cursor, end);
|
|
959
|
+
braced = true;
|
|
960
|
+
cursor = end;
|
|
961
|
+
} else {
|
|
962
|
+
value2 = /^[^\s>]+/.exec(markup.slice(cursor))?.[0] ?? "";
|
|
963
|
+
cursor += value2.length;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
const dynamic = braced || attrName.startsWith(":") || attrName.startsWith("v-bind:") || attrName.startsWith("@") || attrName.startsWith("v-on:") || blocks.kind === "svelte" && value2 !== void 0 && /\{/.test(value2);
|
|
967
|
+
attributes.push({ name: attrName, value: value2, dynamic, offset: attrOffset });
|
|
968
|
+
}
|
|
969
|
+
index = cursor + 1;
|
|
970
|
+
if (closing) {
|
|
971
|
+
const position = open.lastIndexOf(tag);
|
|
972
|
+
if (position !== -1) {
|
|
973
|
+
for (const closed of open.splice(position)) if (closed === "form") formDepth -= 1;
|
|
974
|
+
}
|
|
975
|
+
continue;
|
|
976
|
+
}
|
|
977
|
+
const element = !selfClosing && !VOID_ELEMENTS.has(tag.toLowerCase());
|
|
978
|
+
if (element) open.push(tag);
|
|
979
|
+
if (tag === "form" && element) formDepth += 1;
|
|
980
|
+
for (const attribute of attributes) {
|
|
981
|
+
if (attribute.name === "v-html") {
|
|
982
|
+
block(attribute.offset, "dangerously-set-inner-html", "v-html renders raw HTML");
|
|
983
|
+
}
|
|
984
|
+
if (attribute.name.toLowerCase() === "contenteditable") {
|
|
985
|
+
block(attribute.offset, "content-editable", "contentEditable");
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
if (COMPONENT_STRUCTURE.has(tag)) continue;
|
|
989
|
+
if (COMPONENT_DYNAMIC.has(tag) || attributes.some((attribute) => attribute.name === "is")) {
|
|
990
|
+
block(at, "dynamic-component", `<${tag}> picks what it renders at runtime`);
|
|
991
|
+
continue;
|
|
992
|
+
}
|
|
993
|
+
const intrinsic = /^[a-z][a-z0-9]*$/.test(tag);
|
|
994
|
+
if (!intrinsic) {
|
|
995
|
+
if (!imported.has(tag) && !imported.has(pascal(tag))) {
|
|
996
|
+
block(at, "dynamic-component", `<${tag}> is not a component this file imports`);
|
|
997
|
+
}
|
|
998
|
+
continue;
|
|
999
|
+
}
|
|
1000
|
+
const kind = INTRINSIC_KINDS[tag];
|
|
1001
|
+
if (!facts.tags.includes(tag)) facts.tags.push(tag);
|
|
1002
|
+
facts.elements.total += 1;
|
|
1003
|
+
if (!kind) {
|
|
1004
|
+
block(at, "unmapped-element", `<${tag}> has no native mapping`);
|
|
1005
|
+
continue;
|
|
1006
|
+
}
|
|
1007
|
+
facts.elements.mapped += 1;
|
|
1008
|
+
facts.elements.byKind[kind] = (facts.elements.byKind[kind] ?? 0) + 1;
|
|
1009
|
+
const value = (attr) => attributes.find((attribute) => attribute.name.toLowerCase() === attr);
|
|
1010
|
+
const boundAttribute = (attr) => attributes.find(
|
|
1011
|
+
(attribute) => attribute.dynamic && (attribute.name === `:${attr}` || attribute.name === `v-bind:${attr}` || attribute.name === attr) || attr === "class" && attribute.name.startsWith("class:")
|
|
1012
|
+
);
|
|
1013
|
+
const classes = value("class");
|
|
1014
|
+
if (boundAttribute("class")) {
|
|
1015
|
+
block(at, "runtime-class-name", `<${tag}> builds its class names at runtime`);
|
|
1016
|
+
} else if (classes?.value) {
|
|
1017
|
+
for (const token of classes.value.split(/\s+/).filter(Boolean)) {
|
|
1018
|
+
const problem = classifyClass(token);
|
|
1019
|
+
if (problem && /^class ".*" is not in the native Tailwind subset$/.test(problem)) {
|
|
1020
|
+
facts.appClasses.push({ name: token, ...locate(starts, classes.offset) });
|
|
1021
|
+
} else if (problem) block(classes.offset, "class-name", problem);
|
|
1022
|
+
else {
|
|
1023
|
+
const native = farmNativeClassProblem(token);
|
|
1024
|
+
if (native) block(classes.offset, "class-name", native, "native");
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
const style = value("style");
|
|
1029
|
+
if (boundAttribute("style")) {
|
|
1030
|
+
block(at, "runtime-style", `<${tag}> style is computed at runtime`);
|
|
1031
|
+
} else if (style?.value) {
|
|
1032
|
+
for (const declaration of resolveFarmNativeInlineStyle(style.value).unsupported) {
|
|
1033
|
+
block(
|
|
1034
|
+
style.offset,
|
|
1035
|
+
"style",
|
|
1036
|
+
`<${tag}> style "${declaration}" has no native-tier style`,
|
|
1037
|
+
"native"
|
|
1038
|
+
);
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
const type = value("type");
|
|
1042
|
+
if (tag === "input") {
|
|
1043
|
+
const inputType = type?.dynamic ? void 0 : (type?.value ?? "text").toLowerCase();
|
|
1044
|
+
const formType = formDepth > 0 && (inputType === "hidden" || inputType === "submit");
|
|
1045
|
+
if (!formType && (inputType === void 0 || !INPUT_TYPES.has(inputType))) {
|
|
1046
|
+
block(
|
|
1047
|
+
at,
|
|
1048
|
+
"unmapped-element",
|
|
1049
|
+
`<input type="${inputType ?? "{expr}"}"> has no native mapping`
|
|
1050
|
+
);
|
|
1051
|
+
continue;
|
|
1052
|
+
}
|
|
1053
|
+
if (inputType === "hidden") continue;
|
|
1054
|
+
}
|
|
1055
|
+
const buttonType = tag === "button" ? (type?.value ?? "submit").toLowerCase() : void 0;
|
|
1056
|
+
if ((tag === "button" || kind === "TextInput") && !value("action") && !value("formaction") && (formDepth === 0 || buttonType !== void 0 && buttonType !== "submit")) {
|
|
1057
|
+
block(
|
|
1058
|
+
at,
|
|
1059
|
+
"inert-control",
|
|
1060
|
+
formDepth > 0 ? `<button type="${buttonType}"> does nothing on a native-tier screen` : `<${tag}> has no link or form to submit on a native-tier screen`,
|
|
1061
|
+
"native"
|
|
1062
|
+
);
|
|
1063
|
+
}
|
|
1064
|
+
if (tag === "form") {
|
|
1065
|
+
const method = value("method");
|
|
1066
|
+
const methodValue = (method?.value ?? "get").toLowerCase();
|
|
1067
|
+
if (method?.dynamic || methodValue !== "get" && methodValue !== "post") {
|
|
1068
|
+
block(at, "form-action", `<form method="${method?.value ?? "{expr}"}">`, "native");
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
return facts;
|
|
1074
|
+
}
|
|
1075
|
+
function closeBrace(text, start) {
|
|
1076
|
+
let depth = 0;
|
|
1077
|
+
for (let index = start; index < text.length; index += 1) {
|
|
1078
|
+
const char = text[index];
|
|
1079
|
+
if (char === '"' || char === "'" || char === "`") {
|
|
1080
|
+
const end = text.indexOf(char, index + 1);
|
|
1081
|
+
if (end === -1) return text.length;
|
|
1082
|
+
index = end;
|
|
1083
|
+
} else if (char === "{") depth += 1;
|
|
1084
|
+
else if (char === "}") {
|
|
1085
|
+
depth -= 1;
|
|
1086
|
+
if (depth === 0) return index + 1;
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
return text.length;
|
|
1090
|
+
}
|
|
783
1091
|
function readAliases(root, srcDir) {
|
|
784
1092
|
const aliases = [{ prefix: "@/", targets: [path.join(root, srcDir) + path.sep] }];
|
|
785
1093
|
try {
|
|
@@ -922,11 +1230,14 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
922
1230
|
let pending = facts.get(file);
|
|
923
1231
|
if (!pending) {
|
|
924
1232
|
pending = readFile(file, "utf8").then((source) => {
|
|
925
|
-
const
|
|
1233
|
+
const component = farmComponentKind(file);
|
|
1234
|
+
const hash = createHash("sha1").update(
|
|
1235
|
+
component ? `${component}\0` : file.endsWith(".tsx") ? "tsx\0" : file.endsWith(".ts") ? "ts\0" : "jsx\0"
|
|
1236
|
+
).update(source).digest("hex");
|
|
926
1237
|
let result = cache.modules[hash];
|
|
927
1238
|
if (result) cached += 1;
|
|
928
1239
|
else {
|
|
929
|
-
result = analyzeSource(file, source, parseSync);
|
|
1240
|
+
result = component ? analyzeComponentSource(file, source, parseSync) : analyzeSource(file, source, parseSync);
|
|
930
1241
|
parsed += 1;
|
|
931
1242
|
}
|
|
932
1243
|
used[hash] = result;
|
|
@@ -990,7 +1301,7 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
990
1301
|
}
|
|
991
1302
|
};
|
|
992
1303
|
}
|
|
993
|
-
if (!
|
|
1304
|
+
if (!isModuleFile(file)) {
|
|
994
1305
|
return {
|
|
995
1306
|
fact,
|
|
996
1307
|
blocker: {
|
|
@@ -1027,8 +1338,7 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
1027
1338
|
const scripts = /* @__PURE__ */ new Set();
|
|
1028
1339
|
for (const { page, layouts } of entries.values()) {
|
|
1029
1340
|
for (const file of [page, ...layouts]) {
|
|
1030
|
-
if (file &&
|
|
1031
|
-
scripts.add(file);
|
|
1341
|
+
if (file && isModuleFile(file)) scripts.add(file);
|
|
1032
1342
|
}
|
|
1033
1343
|
}
|
|
1034
1344
|
await Promise.all([...scripts].map(visitModule));
|
|
@@ -1059,6 +1369,7 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
1059
1369
|
const tags = /* @__PURE__ */ new Set();
|
|
1060
1370
|
const graph = [];
|
|
1061
1371
|
const layoutClasses = /* @__PURE__ */ new Set();
|
|
1372
|
+
const componentSheets = [];
|
|
1062
1373
|
const walk = (file, entry, layout) => {
|
|
1063
1374
|
if (seen.has(file)) return;
|
|
1064
1375
|
seen.add(file);
|
|
@@ -1113,6 +1424,9 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
1113
1424
|
for (const appClass of moduleFacts.appClasses)
|
|
1114
1425
|
appClasses.push({ file: label, ...appClass });
|
|
1115
1426
|
for (const tag of moduleFacts.tags) tags.add(tag);
|
|
1427
|
+
for (const css of moduleFacts.styles ?? []) {
|
|
1428
|
+
componentSheets.push(parseFarmNativeStylesheet(css));
|
|
1429
|
+
}
|
|
1116
1430
|
}
|
|
1117
1431
|
for (const win of moduleFacts.wins) wins.add(win);
|
|
1118
1432
|
elements.total += moduleFacts.elements.total;
|
|
@@ -1155,7 +1469,7 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
1155
1469
|
ir.root = `${relative2(root, page)}#default`;
|
|
1156
1470
|
}
|
|
1157
1471
|
for (const layout of layouts) walk(layout, true, true);
|
|
1158
|
-
const sheets = [...stylesheets].map(readStylesheet);
|
|
1472
|
+
const sheets = [...[...stylesheets].map(readStylesheet), ...componentSheets];
|
|
1159
1473
|
for (const appClass of appClasses) {
|
|
1160
1474
|
const { styled, problems } = inspectFarmNativeStylesheets(sheets, { class: appClass.name });
|
|
1161
1475
|
const at = { file: appClass.file, line: appClass.line, column: appClass.column };
|
|
@@ -6,7 +6,7 @@ var _chunkUNJZGVPUcjs = require('./chunk-UNJZGVPU.cjs');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk2C5L5RPMcjs = require('./chunk-2C5L5RPM.cjs');
|
|
10
10
|
|
|
11
11
|
// src/app-markdown-runtime.ts
|
|
12
12
|
var _url = require('url');
|
|
@@ -160,7 +160,7 @@ async function anonymousVisitorOpensPage(options, url, targetPathname) {
|
|
|
160
160
|
if (!PAGE_CHECK_DROPPED_HEADERS.has(name.toLowerCase())) headers.append(name, value);
|
|
161
161
|
}
|
|
162
162
|
headers.set("accept", "text/html");
|
|
163
|
-
headers.set(
|
|
163
|
+
headers.set(_chunk2C5L5RPMcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER, _chunk2C5L5RPMcjs._getFarmMarkdownPageCheckToken.call(void 0, ));
|
|
164
164
|
const response = await options.renderPage(
|
|
165
165
|
new Request(pageUrl, {
|
|
166
166
|
method: "GET",
|
|
@@ -192,7 +192,7 @@ async function createFarmMarkdownSourceResponse(options) {
|
|
|
192
192
|
}
|
|
193
193
|
const url = new URL(options.request.url);
|
|
194
194
|
const hasMarkdownExtension = url.pathname.toLowerCase().endsWith(".md");
|
|
195
|
-
if (!hasMarkdownExtension && !
|
|
195
|
+
if (!hasMarkdownExtension && !_chunk2C5L5RPMcjs.requestAcceptsMarkdown.call(void 0, options.request.headers.get("accept"))) {
|
|
196
196
|
return null;
|
|
197
197
|
}
|
|
198
198
|
const targetPathname = normalizeFarmMarkdownRoutePath(url.pathname);
|
|
@@ -254,7 +254,7 @@ async function createFarmMarkdownSourceResponse(options) {
|
|
|
254
254
|
if (!hasMarkdownExtension) {
|
|
255
255
|
headers.set("Vary", "Accept");
|
|
256
256
|
}
|
|
257
|
-
return
|
|
257
|
+
return _chunk2C5L5RPMcjs.createFarmMarkdownViewResponse.call(void 0, {
|
|
258
258
|
request: options.request,
|
|
259
259
|
requestUrl: url,
|
|
260
260
|
markdown: source.source,
|
|
@@ -25,7 +25,7 @@ var _chunkRD623KW4cjs = require('./chunk-RD623KW4.cjs');
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _chunkO6L3YYPMcjs = require('./chunk-O6L3YYPM.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
@@ -36,7 +36,7 @@ var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
|
|
|
36
36
|
var _chunkBTVDYS4Bcjs = require('./chunk-BTVDYS4B.cjs');
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
var
|
|
39
|
+
var _chunkFJWN7RV4cjs = require('./chunk-FJWN7RV4.cjs');
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
@@ -53,7 +53,7 @@ var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
|
|
|
53
53
|
var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
|
|
54
54
|
|
|
55
55
|
|
|
56
|
-
var
|
|
56
|
+
var _chunk2C5L5RPMcjs = require('./chunk-2C5L5RPM.cjs');
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
var _chunkDQJ2CIH7cjs = require('./chunk-DQJ2CIH7.cjs');
|
|
@@ -417,13 +417,13 @@ function resolveFarmAgentConfig(input, context = {}) {
|
|
|
417
417
|
const jsonLd = _optionalChain([input, 'optionalAccess', _17 => _17.jsonLd]);
|
|
418
418
|
return {
|
|
419
419
|
jsonLd: jsonLd === void 0 ? { ...DEFAULT_JSON_LD } : !jsonLd ? false : jsonLd === true ? {} : jsonLd,
|
|
420
|
-
noindexPreviews:
|
|
420
|
+
noindexPreviews: _chunkO6L3YYPMcjs.resolveFarmNoindexPreviews.call(void 0, _optionalChain([input, 'optionalAccess', _18 => _18.noindexPreviews])),
|
|
421
421
|
// The docs engine answers /llms.txt with its own pages; a default here would replace it.
|
|
422
422
|
// llms-full.txt renders every listed page, so it stays opt-in.
|
|
423
|
-
llmsTxt:
|
|
423
|
+
llmsTxt: _chunkFJWN7RV4cjs.resolveFarmLlmsTxtConfig.call(void 0, _nullishCoalesce(_optionalChain([input, 'optionalAccess', _19 => _19.llmsTxt]), () => ( (context.docs ? false : { full: false })))),
|
|
424
424
|
// Same rule as llms.txt: the docs engine answers /sitemap.xml with its own pages.
|
|
425
|
-
sitemap:
|
|
426
|
-
crawlers:
|
|
425
|
+
sitemap: _chunkO6L3YYPMcjs.resolveFarmAgentSitemap.call(void 0, _nullishCoalesce(_optionalChain([input, 'optionalAccess', _20 => _20.sitemap]), () => ( !context.docs))),
|
|
426
|
+
crawlers: _chunkO6L3YYPMcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([input, 'optionalAccess', _21 => _21.crawlers])),
|
|
427
427
|
apiCatalog: resolveFarmAgentBoolean(_optionalChain([input, 'optionalAccess', _22 => _22.apiCatalog]), "apiCatalog", false),
|
|
428
428
|
aiCatalog: resolveFarmAgentBoolean(_optionalChain([input, 'optionalAccess', _23 => _23.aiCatalog]), "aiCatalog", true),
|
|
429
429
|
manifest: _chunkBTVDYS4Bcjs.resolveFarmAppManifestConfig.call(void 0, _optionalChain([input, 'optionalAccess', _24 => _24.manifest])),
|
|
@@ -1076,7 +1076,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
1076
1076
|
const srcDir = userConfig.srcDir || "src";
|
|
1077
1077
|
_chunkBPNOYILCcjs.setFarmProjectSourceDir.call(void 0, root, srcDir);
|
|
1078
1078
|
const docs = await resolveDocsConfig(userConfig.docs, { root, srcDir });
|
|
1079
|
-
const md =
|
|
1079
|
+
const md = _chunk2C5L5RPMcjs.resolveMarkdownConfig.call(void 0, userConfig.md);
|
|
1080
1080
|
const mdx = _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, userConfig.mdx);
|
|
1081
1081
|
const env = _chunk3EIPOTZVcjs.resolveEnv.call(void 0, userConfig.env, process.env);
|
|
1082
1082
|
_chunk3EIPOTZVcjs.setEnv.call(void 0, env);
|
|
@@ -1184,7 +1184,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
1184
1184
|
],
|
|
1185
1185
|
routeRules,
|
|
1186
1186
|
images: _chunkHEPJIKKQcjs.resolveFarmImageConfig.call(void 0, userConfig.images),
|
|
1187
|
-
performance:
|
|
1187
|
+
performance: _chunkO6L3YYPMcjs.resolveFarmPerformanceConfig.call(void 0, userConfig.performance),
|
|
1188
1188
|
theme: _chunkWT6RAN2Icjs.resolveFarmThemeConfig.call(void 0, userConfig.theme, basePath),
|
|
1189
1189
|
publicDir: userConfig.publicDir || "public",
|
|
1190
1190
|
i18n: _chunkLNVGXUL3cjs.resolveFarmI18nConfig.call(void 0, userConfig.i18n, { root, mode, basePath }),
|