@farm.js/core 0.1.63 → 0.1.65
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-GHWK46LX.cjs +16 -0
- package/dist/{analyzer-WNPQPWFR.mjs → analyzer-PE33SK5W.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-BA2IA32Q.mjs → chunk-2L54YV25.mjs} +13 -11
- package/dist/{chunk-5IKQ7BIR.cjs → chunk-32RPJAAS.cjs} +16 -16
- package/dist/{chunk-QN5WRQSQ.cjs → chunk-3KJPIO5D.cjs} +610 -3102
- package/dist/{chunk-EENTT56C.mjs → chunk-6X5NKNBE.mjs} +43 -38
- package/dist/{chunk-RFYL5OLP.mjs → chunk-72JSHQQQ.mjs} +1 -1
- package/dist/{chunk-LA45FN37.mjs → chunk-7GYCZRTH.mjs} +386 -2878
- package/dist/chunk-7QVRWGBL.cjs +3704 -0
- package/dist/{chunk-PRFNLQSP.cjs → chunk-7XGWBPQQ.cjs} +4 -4
- package/dist/{chunk-FNHN3RBD.cjs → chunk-A3G5IY2W.cjs} +1 -1
- package/dist/{chunk-EYLC6GD6.cjs → chunk-C7DCMGC4.cjs} +12 -12
- package/dist/chunk-CJNAUEVC.mjs +34 -0
- package/dist/{chunk-LFFSDZ4Y.cjs → chunk-CZF4XIRZ.cjs} +3 -3
- package/dist/{chunk-7FFW7DC4.mjs → chunk-E2TSYUHV.mjs} +4 -4
- package/dist/{chunk-55U5QIXQ.mjs → chunk-FIR62CR3.mjs} +1 -1
- package/dist/{chunk-MEQN6DDA.cjs → chunk-FJWN7RV4.cjs} +5 -5
- package/dist/{chunk-VVTJTMGQ.cjs → chunk-GL7N5UHF.cjs} +4 -4
- package/dist/{chunk-4DIKLG56.mjs → chunk-GRBJ7VKH.mjs} +1 -1
- package/dist/{chunk-UR25Z5Z6.mjs → chunk-HCGWDRZO.mjs} +1 -1
- package/dist/{chunk-GPKBUME5.mjs → chunk-HKNYNSOK.mjs} +2 -2
- package/dist/{chunk-U6WCUVSV.cjs → chunk-IMK32ERL.cjs} +23 -21
- package/dist/chunk-IOEXXZK3.mjs +88 -0
- package/dist/{chunk-IOF4KXMP.mjs → chunk-IP2KHSGF.mjs} +205 -26
- package/dist/{chunk-YSXTNSXS.mjs → chunk-K7OZAVOI.mjs} +7 -6
- package/dist/{chunk-KVW2M6PI.mjs → chunk-KL7SHLQB.mjs} +1 -1
- package/dist/{chunk-UZZ6IEQP.mjs → chunk-MESQF2JC.mjs} +2 -2
- package/dist/{chunk-DZPR2W6U.cjs → chunk-O6L3YYPM.cjs} +5 -5
- package/dist/{chunk-6BJJYOFL.cjs → chunk-OLIGNTWU.cjs} +7 -7
- package/dist/{chunk-5L7I6AMY.cjs → chunk-OSFIUSYK.cjs} +5 -5
- package/dist/{chunk-LA6O5EL2.mjs → chunk-Q75QPLBA.mjs} +1 -1
- package/dist/{chunk-O5FCWI6O.mjs → chunk-QHRCR44V.mjs} +2 -2
- package/dist/{chunk-E72UD6ME.mjs → chunk-RVGSVQWT.mjs} +1 -1
- package/dist/{chunk-Z74NNER4.cjs → chunk-T4M52BA5.cjs} +164 -159
- package/dist/{chunk-PCXIJKPM.mjs → chunk-TNBJ4LZG.mjs} +2 -2
- package/dist/{chunk-PAKCHVUS.mjs → chunk-TPA2PV5J.mjs} +3 -35
- package/dist/{chunk-Y2YBNQ3D.cjs → chunk-TRIDJQ6A.cjs} +6 -6
- package/dist/{chunk-PVJX4UPA.cjs → chunk-TZOGZKI7.cjs} +411 -295
- package/dist/{chunk-O27PLNQZ.cjs → chunk-UJ3R2AH2.cjs} +4 -4
- package/dist/{chunk-BPNOYILC.cjs → chunk-UVV3I5QA.cjs} +3 -35
- package/dist/{chunk-CBDRR3J3.mjs → chunk-VHHLKIDZ.mjs} +166 -50
- 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-IWRLV46X.cjs → chunk-WMTBBQHY.cjs} +4 -4
- package/dist/{chunk-LWWDTBGL.cjs → chunk-WNXVWXG3.cjs} +2 -2
- package/dist/{chunk-CI4UNQHO.cjs → chunk-XBSKPLHF.cjs} +2 -2
- package/dist/{chunk-QAS7KE7J.cjs → chunk-Y5TOT5F6.cjs} +5 -5
- package/dist/{chunk-ANXU3D32.cjs → chunk-YD4J37RN.cjs} +403 -32
- package/dist/{chunk-XICXQXYE.mjs → chunk-YUW7F6SK.mjs} +2 -2
- package/dist/chunk-ZAUOOGER.mjs +3704 -0
- package/dist/{chunk-DPE53XWL.mjs → chunk-ZEXE4TGY.mjs} +1 -1
- package/dist/chunk-ZIHWAN55.cjs +34 -0
- package/dist/{chunk-GVOMPU3Y.cjs → chunk-ZQQK4U66.cjs} +213 -34
- package/dist/{chunk-S2NUYHRY.mjs → chunk-ZX2JHEWW.mjs} +384 -13
- 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-PUVZB3F2.mjs} +7 -6
- package/dist/{devtools-ZHN5JLVI.cjs → devtools-SGYOG36E.cjs} +8 -7
- package/dist/docs.cjs +10 -9
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +9 -8
- package/dist/environment/vite.cjs +9 -2
- package/dist/environment/vite.d.mts +3 -0
- package/dist/environment/vite.d.ts +3 -0
- package/dist/environment/vite.mjs +8 -1
- package/dist/index.cjs +29 -27
- 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 +28 -26
- 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 +27 -25
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +26 -24
- package/dist/internal/cli-runtime.cjs +10 -9
- package/dist/internal/cli-runtime.mjs +9 -8
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +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 +9 -8
- package/dist/internal/config-runtime.d.mts +4 -4
- package/dist/internal/config-runtime.d.ts +4 -4
- package/dist/internal/config-runtime.mjs +8 -7
- 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 +20 -12
- package/dist/internal/production-runtime.d.ts +20 -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-Z2WYUJEV.cjs → native-tree-HE2FLS72.cjs} +3 -3
- package/dist/{native-tree-AS5L3ID3.mjs → native-tree-YF2DSPKM.mjs} +2 -2
- 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 +18 -17
- package/dist/plugin.d.mts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.mjs +17 -16
- 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-T3PWURLJ.mjs} +9 -8
- package/dist/{rsc-pipeline-RHEZNBFQ.cjs → rsc-pipeline-V4ANLRAA.cjs} +10 -9
- package/dist/{runtime-OZKFZQCU.cjs → runtime-5AROV2C3.cjs} +29 -17
- package/dist/{runtime-X5UR7VHP.mjs → runtime-LRIQ3XH7.mjs} +26 -14
- 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 +42 -41
- package/dist/server.d.mts +9 -9
- package/dist/server.d.ts +9 -9
- package/dist/server.mjs +26 -25
- 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 +21 -19
- package/dist/vite.d.mts +4 -4
- package/dist/vite.d.ts +4 -4
- package/dist/vite.mjs +20 -18
- package/package.json +1 -1
- package/dist/analyzer-KEA5JVDR.cjs +0 -15
- package/dist/chunk-NK2VWS7P.cjs +0 -954
- package/dist/chunk-ZQ5BDNKW.mjs +0 -954
|
@@ -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-72JSHQQQ.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,21 @@ 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 serverFunctions = /* @__PURE__ */ new Set();
|
|
349
|
+
const serverActionReference = (expression) => {
|
|
350
|
+
if (expression?.type === "Identifier") {
|
|
351
|
+
if (serverFunctions.has(expression.name)) return {};
|
|
352
|
+
const binding = imported.get(expression.name);
|
|
353
|
+
return binding ? { source: binding.source } : void 0;
|
|
354
|
+
}
|
|
355
|
+
if (expression?.type === "MemberExpression" && expression.object.type === "Identifier") {
|
|
356
|
+
const binding = imported.get(expression.object.name);
|
|
357
|
+
return binding?.name === "*" ? { source: binding.source } : void 0;
|
|
358
|
+
}
|
|
359
|
+
return void 0;
|
|
360
|
+
};
|
|
361
|
+
const result = parseSync(file, source, { lang });
|
|
337
362
|
if (result.errors.length > 0) {
|
|
338
363
|
const error = result.errors[0];
|
|
339
364
|
const offset = error.labels?.[0]?.start ?? 0;
|
|
@@ -342,6 +367,28 @@ function analyzeSource(file, source, parseSync) {
|
|
|
342
367
|
}
|
|
343
368
|
const program = result.program;
|
|
344
369
|
const wins = /* @__PURE__ */ new Set();
|
|
370
|
+
const usesServer = (body) => body?.type === "BlockStatement" && body.body.some(
|
|
371
|
+
(statement) => statement.type === "ExpressionStatement" && statement.directive === "use server"
|
|
372
|
+
);
|
|
373
|
+
const findServerFunctions = (node) => {
|
|
374
|
+
if (!node || typeof node !== "object") return;
|
|
375
|
+
if (Array.isArray(node)) {
|
|
376
|
+
for (const child of node) findServerFunctions(child);
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
const current = node;
|
|
380
|
+
if (current.type === "FunctionDeclaration" && current.id && usesServer(current.body)) {
|
|
381
|
+
serverFunctions.add(current.id.name);
|
|
382
|
+
} else if (current.type === "VariableDeclarator" && current.id?.type === "Identifier" && (current.init?.type === "ArrowFunctionExpression" || current.init?.type === "FunctionExpression") && usesServer(current.init.body)) {
|
|
383
|
+
serverFunctions.add(current.id.name);
|
|
384
|
+
}
|
|
385
|
+
for (const [key, value] of Object.entries(current)) {
|
|
386
|
+
if (key !== "type" && key !== "start" && key !== "end" && value && typeof value === "object") {
|
|
387
|
+
findServerFunctions(value);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
findServerFunctions(program);
|
|
345
392
|
const imported = /* @__PURE__ */ new Map();
|
|
346
393
|
const topLevel = /* @__PURE__ */ new Set();
|
|
347
394
|
const declared = /* @__PURE__ */ new Set();
|
|
@@ -464,6 +511,7 @@ function analyzeSource(file, source, parseSync) {
|
|
|
464
511
|
const props = {};
|
|
465
512
|
const style = [];
|
|
466
513
|
const events = [];
|
|
514
|
+
let submits = false;
|
|
467
515
|
for (const attribute of opening.attributes) {
|
|
468
516
|
if (attribute.type === "JSXSpreadAttribute") {
|
|
469
517
|
if (isIntrinsic)
|
|
@@ -486,7 +534,19 @@ function analyzeSource(file, source, parseSync) {
|
|
|
486
534
|
continue;
|
|
487
535
|
}
|
|
488
536
|
if ((name === "action" || name === "formAction") && isIntrinsic) {
|
|
489
|
-
|
|
537
|
+
if (staticString(value) === void 0) {
|
|
538
|
+
const reference = serverActionReference(
|
|
539
|
+
value?.type === "JSXExpressionContainer" ? value.expression : void 0
|
|
540
|
+
);
|
|
541
|
+
if (reference) {
|
|
542
|
+
(facts.formActions ?? (facts.formActions = [])).push({
|
|
543
|
+
...reference.source !== void 0 ? { source: reference.source } : {},
|
|
544
|
+
...locate(starts, attribute.start),
|
|
545
|
+
message: `${name} on <${tag}>`
|
|
546
|
+
});
|
|
547
|
+
} else block(attribute, "form-action", `${name} on <${tag}>`);
|
|
548
|
+
}
|
|
549
|
+
submits = true;
|
|
490
550
|
continue;
|
|
491
551
|
}
|
|
492
552
|
if (/^on[A-Z]/.test(name)) {
|
|
@@ -560,7 +620,8 @@ function analyzeSource(file, source, parseSync) {
|
|
|
560
620
|
}
|
|
561
621
|
if (tag === "input" && name === "type") {
|
|
562
622
|
const type = staticString(value);
|
|
563
|
-
|
|
623
|
+
const formType = formDepth > 0 && (type === "hidden" || type === "submit");
|
|
624
|
+
if (!formType && (type === void 0 || !INPUT_TYPES.has(type))) {
|
|
564
625
|
block(
|
|
565
626
|
attribute,
|
|
566
627
|
"unmapped-element",
|
|
@@ -577,6 +638,22 @@ function analyzeSource(file, source, parseSync) {
|
|
|
577
638
|
if (kind === "TextInput" && events.some((event) => event === "onChange" || event === "onInput")) {
|
|
578
639
|
wins.add("input");
|
|
579
640
|
}
|
|
641
|
+
const inForm = formDepth > 0;
|
|
642
|
+
const buttonType = tag === "button" ? props.type ?? "submit" : void 0;
|
|
643
|
+
if (isIntrinsic && (tag === "button" || kind === "TextInput") && events.length === 0 && !submits && props.type !== "hidden" && (!inForm || buttonType !== void 0 && buttonType !== "submit")) {
|
|
644
|
+
block(
|
|
645
|
+
opening,
|
|
646
|
+
"inert-control",
|
|
647
|
+
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`,
|
|
648
|
+
"native"
|
|
649
|
+
);
|
|
650
|
+
}
|
|
651
|
+
if (isIntrinsic && tag === "form") {
|
|
652
|
+
const method = typeof props.method === "string" ? props.method.toLowerCase() : "get";
|
|
653
|
+
if (props.method === "{expr}" || method !== "get" && method !== "post") {
|
|
654
|
+
block(opening, "form-action", `<form method="${String(props.method)}">`, "native");
|
|
655
|
+
}
|
|
656
|
+
}
|
|
580
657
|
if (Object.keys(props).length > 0) node.props = props;
|
|
581
658
|
if (style.length > 0) node.style = style;
|
|
582
659
|
if (events.length > 0) node.events = events;
|
|
@@ -604,7 +681,10 @@ function analyzeSource(file, source, parseSync) {
|
|
|
604
681
|
for (const attribute of node.openingElement.attributes) {
|
|
605
682
|
visit(attribute.type === "JSXSpreadAttribute" ? attribute.argument : attribute.value);
|
|
606
683
|
}
|
|
684
|
+
const form = ui.tag === "form";
|
|
685
|
+
if (form) formDepth += 1;
|
|
607
686
|
visitChildren(node.children, ui);
|
|
687
|
+
if (form) formDepth -= 1;
|
|
608
688
|
append(parent, ui);
|
|
609
689
|
return ui;
|
|
610
690
|
}
|
|
@@ -780,6 +860,278 @@ function analyzeSource(file, source, parseSync) {
|
|
|
780
860
|
facts.blockers.sort((left, right) => left.line - right.line || left.column - right.column);
|
|
781
861
|
return facts;
|
|
782
862
|
}
|
|
863
|
+
var COMPONENT_STRUCTURE = /* @__PURE__ */ new Set([
|
|
864
|
+
"template",
|
|
865
|
+
"slot",
|
|
866
|
+
"Transition",
|
|
867
|
+
"TransitionGroup",
|
|
868
|
+
"KeepAlive",
|
|
869
|
+
"Suspense",
|
|
870
|
+
"svelte:head",
|
|
871
|
+
"svelte:fragment",
|
|
872
|
+
"svelte:options",
|
|
873
|
+
"svelte:window",
|
|
874
|
+
"svelte:body",
|
|
875
|
+
"svelte:document",
|
|
876
|
+
"svelte:boundary"
|
|
877
|
+
]);
|
|
878
|
+
var COMPONENT_DYNAMIC = /* @__PURE__ */ new Set(["component", "svelte:element", "svelte:component", "Teleport"]);
|
|
879
|
+
var VOID_ELEMENTS = new Set(
|
|
880
|
+
"area base br col embed hr img input link meta source track wbr".split(" ")
|
|
881
|
+
);
|
|
882
|
+
function analyzeComponentSource(file, source, parseSync) {
|
|
883
|
+
const blocks = readFarmComponentBlocks(file, source);
|
|
884
|
+
const name = blocks.kind === "vue" ? "Vue" : "Svelte";
|
|
885
|
+
const scripts = keepFarmComponentRanges(source, blocks.scripts);
|
|
886
|
+
const typed = blocks.scripts.some((script) => script.attributes.lang === "tsx") ? "tsx" : "ts";
|
|
887
|
+
const facts = analyzeSource(file, scripts, parseSync, typed);
|
|
888
|
+
facts.blockers = facts.blockers.filter((blocker) => blocker.rule !== "client-logic");
|
|
889
|
+
const starts = lineStarts(source);
|
|
890
|
+
const block = (offset, rule, message, only) => facts.blockers.push({ ...locate(starts, offset), rule, message, ...only ? { only } : {} });
|
|
891
|
+
facts.blockers.push({
|
|
892
|
+
line: 1,
|
|
893
|
+
column: 1,
|
|
894
|
+
rule: "renderer-component",
|
|
895
|
+
message: `a ${name} component has no React Native port`,
|
|
896
|
+
only: "react-native"
|
|
897
|
+
});
|
|
898
|
+
for (const script of farmComponentModuleScripts(blocks)) {
|
|
899
|
+
const hydrate = /\bexport\s+const\s+hydrate\s*=\s*true\b/.exec(
|
|
900
|
+
source.slice(script.start, script.end)
|
|
901
|
+
);
|
|
902
|
+
if (hydrate) {
|
|
903
|
+
block(
|
|
904
|
+
script.start + hydrate.index,
|
|
905
|
+
"client-logic",
|
|
906
|
+
"it exports hydrate = true, which hydrates the page in the browser",
|
|
907
|
+
"native"
|
|
908
|
+
);
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
const styles = blocks.styles.filter((style) => !style.attributes.lang || style.attributes.lang === "css").map((style) => source.slice(style.start, style.end));
|
|
912
|
+
if (styles.length > 0) facts.styles = styles;
|
|
913
|
+
for (const style of blocks.styles) {
|
|
914
|
+
if (style.attributes.lang && style.attributes.lang !== "css") {
|
|
915
|
+
block(
|
|
916
|
+
style.start,
|
|
917
|
+
"css-import",
|
|
918
|
+
`<style lang="${String(style.attributes.lang)}"> is not CSS`
|
|
919
|
+
);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
const imported = /* @__PURE__ */ new Set();
|
|
923
|
+
for (const script of blocks.scripts) {
|
|
924
|
+
const text = source.slice(script.start, script.end);
|
|
925
|
+
for (const match of text.matchAll(/\bimport\s+(?:type\s+)?([\w$]+)\s*(?:,|from\b)/g)) {
|
|
926
|
+
imported.add(match[1]);
|
|
927
|
+
}
|
|
928
|
+
for (const match of text.matchAll(/\bimport\s+(?:[\w$]+\s*,\s*)?\{([^}]*)\}/g)) {
|
|
929
|
+
for (const part of match[1].split(",")) {
|
|
930
|
+
const local = part.trim().split(/\s+as\s+/).pop()?.trim();
|
|
931
|
+
if (local) imported.add(local);
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
const pascal = (tag) => tag.replace(/(^|-)([a-z])/g, (_, __, letter) => letter.toUpperCase());
|
|
936
|
+
let formDepth = 0;
|
|
937
|
+
const open = [];
|
|
938
|
+
for (const range of blocks.markup) {
|
|
939
|
+
const markup = source.slice(range.start, range.end);
|
|
940
|
+
let index = 0;
|
|
941
|
+
while (index < markup.length) {
|
|
942
|
+
const at = range.start + index;
|
|
943
|
+
if (markup.startsWith("<!--", index)) {
|
|
944
|
+
const end = markup.indexOf("-->", index + 4);
|
|
945
|
+
index = end === -1 ? markup.length : end + 3;
|
|
946
|
+
continue;
|
|
947
|
+
}
|
|
948
|
+
if (markup[index] === "{") {
|
|
949
|
+
const end = closeBrace(markup, index);
|
|
950
|
+
if (blocks.kind === "svelte" && /^\{@html\b/.test(markup.slice(index))) {
|
|
951
|
+
block(at, "dangerously-set-inner-html", "{@html} renders raw HTML");
|
|
952
|
+
}
|
|
953
|
+
index = end;
|
|
954
|
+
continue;
|
|
955
|
+
}
|
|
956
|
+
if (markup[index] !== "<") {
|
|
957
|
+
index += 1;
|
|
958
|
+
continue;
|
|
959
|
+
}
|
|
960
|
+
const closing = markup[index + 1] === "/";
|
|
961
|
+
const nameMatch = /^[A-Za-z][\w:.-]*/.exec(markup.slice(index + (closing ? 2 : 1)));
|
|
962
|
+
if (!nameMatch) {
|
|
963
|
+
index += 1;
|
|
964
|
+
continue;
|
|
965
|
+
}
|
|
966
|
+
const tag = nameMatch[0];
|
|
967
|
+
let cursor = index + (closing ? 2 : 1) + tag.length;
|
|
968
|
+
const attributes = [];
|
|
969
|
+
let selfClosing = false;
|
|
970
|
+
while (cursor < markup.length && markup[cursor] !== ">") {
|
|
971
|
+
const char = markup[cursor];
|
|
972
|
+
if (/\s/.test(char)) {
|
|
973
|
+
cursor += 1;
|
|
974
|
+
continue;
|
|
975
|
+
}
|
|
976
|
+
if (char === "/" && markup[cursor + 1] === ">") {
|
|
977
|
+
selfClosing = true;
|
|
978
|
+
cursor += 1;
|
|
979
|
+
continue;
|
|
980
|
+
}
|
|
981
|
+
if (char === "{") {
|
|
982
|
+
attributes.push({ name: "{", dynamic: true, offset: range.start + cursor });
|
|
983
|
+
cursor = closeBrace(markup, cursor);
|
|
984
|
+
continue;
|
|
985
|
+
}
|
|
986
|
+
const attrName = /^[^\s=/>]+/.exec(markup.slice(cursor))?.[0] ?? char;
|
|
987
|
+
const attrOffset = range.start + cursor;
|
|
988
|
+
cursor += attrName.length;
|
|
989
|
+
while (/\s/.test(markup[cursor] ?? "")) cursor += 1;
|
|
990
|
+
let value2;
|
|
991
|
+
let braced = false;
|
|
992
|
+
if (markup[cursor] === "=") {
|
|
993
|
+
cursor += 1;
|
|
994
|
+
while (/\s/.test(markup[cursor] ?? "")) cursor += 1;
|
|
995
|
+
const quote = markup[cursor];
|
|
996
|
+
if (quote === '"' || quote === "'") {
|
|
997
|
+
const end = markup.indexOf(quote, cursor + 1);
|
|
998
|
+
value2 = markup.slice(cursor + 1, end === -1 ? markup.length : end);
|
|
999
|
+
cursor = end === -1 ? markup.length : end + 1;
|
|
1000
|
+
} else if (quote === "{") {
|
|
1001
|
+
const end = closeBrace(markup, cursor);
|
|
1002
|
+
value2 = markup.slice(cursor, end);
|
|
1003
|
+
braced = true;
|
|
1004
|
+
cursor = end;
|
|
1005
|
+
} else {
|
|
1006
|
+
value2 = /^[^\s>]+/.exec(markup.slice(cursor))?.[0] ?? "";
|
|
1007
|
+
cursor += value2.length;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
const dynamic = braced || attrName.startsWith(":") || attrName.startsWith("v-bind:") || attrName.startsWith("@") || attrName.startsWith("v-on:") || blocks.kind === "svelte" && value2 !== void 0 && /\{/.test(value2);
|
|
1011
|
+
attributes.push({ name: attrName, value: value2, dynamic, offset: attrOffset });
|
|
1012
|
+
}
|
|
1013
|
+
index = cursor + 1;
|
|
1014
|
+
if (closing) {
|
|
1015
|
+
const position = open.lastIndexOf(tag);
|
|
1016
|
+
if (position !== -1) {
|
|
1017
|
+
for (const closed of open.splice(position)) if (closed === "form") formDepth -= 1;
|
|
1018
|
+
}
|
|
1019
|
+
continue;
|
|
1020
|
+
}
|
|
1021
|
+
const element = !selfClosing && !VOID_ELEMENTS.has(tag.toLowerCase());
|
|
1022
|
+
if (element) open.push(tag);
|
|
1023
|
+
if (tag === "form" && element) formDepth += 1;
|
|
1024
|
+
for (const attribute of attributes) {
|
|
1025
|
+
if (attribute.name === "v-html") {
|
|
1026
|
+
block(attribute.offset, "dangerously-set-inner-html", "v-html renders raw HTML");
|
|
1027
|
+
}
|
|
1028
|
+
if (attribute.name.toLowerCase() === "contenteditable") {
|
|
1029
|
+
block(attribute.offset, "content-editable", "contentEditable");
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
if (COMPONENT_STRUCTURE.has(tag)) continue;
|
|
1033
|
+
if (COMPONENT_DYNAMIC.has(tag) || attributes.some((attribute) => attribute.name === "is")) {
|
|
1034
|
+
block(at, "dynamic-component", `<${tag}> picks what it renders at runtime`);
|
|
1035
|
+
continue;
|
|
1036
|
+
}
|
|
1037
|
+
const intrinsic = /^[a-z][a-z0-9]*$/.test(tag);
|
|
1038
|
+
if (!intrinsic) {
|
|
1039
|
+
if (!imported.has(tag) && !imported.has(pascal(tag))) {
|
|
1040
|
+
block(at, "dynamic-component", `<${tag}> is not a component this file imports`);
|
|
1041
|
+
}
|
|
1042
|
+
continue;
|
|
1043
|
+
}
|
|
1044
|
+
const kind = INTRINSIC_KINDS[tag];
|
|
1045
|
+
if (!facts.tags.includes(tag)) facts.tags.push(tag);
|
|
1046
|
+
facts.elements.total += 1;
|
|
1047
|
+
if (!kind) {
|
|
1048
|
+
block(at, "unmapped-element", `<${tag}> has no native mapping`);
|
|
1049
|
+
continue;
|
|
1050
|
+
}
|
|
1051
|
+
facts.elements.mapped += 1;
|
|
1052
|
+
facts.elements.byKind[kind] = (facts.elements.byKind[kind] ?? 0) + 1;
|
|
1053
|
+
const value = (attr) => attributes.find((attribute) => attribute.name.toLowerCase() === attr);
|
|
1054
|
+
const boundAttribute = (attr) => attributes.find(
|
|
1055
|
+
(attribute) => attribute.dynamic && (attribute.name === `:${attr}` || attribute.name === `v-bind:${attr}` || attribute.name === attr) || attr === "class" && attribute.name.startsWith("class:")
|
|
1056
|
+
);
|
|
1057
|
+
const classes = value("class");
|
|
1058
|
+
if (boundAttribute("class")) {
|
|
1059
|
+
block(at, "runtime-class-name", `<${tag}> builds its class names at runtime`);
|
|
1060
|
+
} else if (classes?.value) {
|
|
1061
|
+
for (const token of classes.value.split(/\s+/).filter(Boolean)) {
|
|
1062
|
+
const problem = classifyClass(token);
|
|
1063
|
+
if (problem && /^class ".*" is not in the native Tailwind subset$/.test(problem)) {
|
|
1064
|
+
facts.appClasses.push({ name: token, ...locate(starts, classes.offset) });
|
|
1065
|
+
} else if (problem) block(classes.offset, "class-name", problem);
|
|
1066
|
+
else {
|
|
1067
|
+
const native = farmNativeClassProblem(token);
|
|
1068
|
+
if (native) block(classes.offset, "class-name", native, "native");
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
const style = value("style");
|
|
1073
|
+
if (boundAttribute("style")) {
|
|
1074
|
+
block(at, "runtime-style", `<${tag}> style is computed at runtime`);
|
|
1075
|
+
} else if (style?.value) {
|
|
1076
|
+
for (const declaration of resolveFarmNativeInlineStyle(style.value).unsupported) {
|
|
1077
|
+
block(
|
|
1078
|
+
style.offset,
|
|
1079
|
+
"style",
|
|
1080
|
+
`<${tag}> style "${declaration}" has no native-tier style`,
|
|
1081
|
+
"native"
|
|
1082
|
+
);
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
const type = value("type");
|
|
1086
|
+
if (tag === "input") {
|
|
1087
|
+
const inputType = type?.dynamic ? void 0 : (type?.value ?? "text").toLowerCase();
|
|
1088
|
+
const formType = formDepth > 0 && (inputType === "hidden" || inputType === "submit");
|
|
1089
|
+
if (!formType && (inputType === void 0 || !INPUT_TYPES.has(inputType))) {
|
|
1090
|
+
block(
|
|
1091
|
+
at,
|
|
1092
|
+
"unmapped-element",
|
|
1093
|
+
`<input type="${inputType ?? "{expr}"}"> has no native mapping`
|
|
1094
|
+
);
|
|
1095
|
+
continue;
|
|
1096
|
+
}
|
|
1097
|
+
if (inputType === "hidden") continue;
|
|
1098
|
+
}
|
|
1099
|
+
const buttonType = tag === "button" ? (type?.value ?? "submit").toLowerCase() : void 0;
|
|
1100
|
+
if ((tag === "button" || kind === "TextInput") && !value("action") && !value("formaction") && (formDepth === 0 || buttonType !== void 0 && buttonType !== "submit")) {
|
|
1101
|
+
block(
|
|
1102
|
+
at,
|
|
1103
|
+
"inert-control",
|
|
1104
|
+
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`,
|
|
1105
|
+
"native"
|
|
1106
|
+
);
|
|
1107
|
+
}
|
|
1108
|
+
if (tag === "form") {
|
|
1109
|
+
const method = value("method");
|
|
1110
|
+
const methodValue = (method?.value ?? "get").toLowerCase();
|
|
1111
|
+
if (method?.dynamic || methodValue !== "get" && methodValue !== "post") {
|
|
1112
|
+
block(at, "form-action", `<form method="${method?.value ?? "{expr}"}">`, "native");
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
return facts;
|
|
1118
|
+
}
|
|
1119
|
+
function closeBrace(text, start) {
|
|
1120
|
+
let depth = 0;
|
|
1121
|
+
for (let index = start; index < text.length; index += 1) {
|
|
1122
|
+
const char = text[index];
|
|
1123
|
+
if (char === '"' || char === "'" || char === "`") {
|
|
1124
|
+
const end = text.indexOf(char, index + 1);
|
|
1125
|
+
if (end === -1) return text.length;
|
|
1126
|
+
index = end;
|
|
1127
|
+
} else if (char === "{") depth += 1;
|
|
1128
|
+
else if (char === "}") {
|
|
1129
|
+
depth -= 1;
|
|
1130
|
+
if (depth === 0) return index + 1;
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
return text.length;
|
|
1134
|
+
}
|
|
783
1135
|
function readAliases(root, srcDir) {
|
|
784
1136
|
const aliases = [{ prefix: "@/", targets: [path.join(root, srcDir) + path.sep] }];
|
|
785
1137
|
try {
|
|
@@ -922,11 +1274,14 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
922
1274
|
let pending = facts.get(file);
|
|
923
1275
|
if (!pending) {
|
|
924
1276
|
pending = readFile(file, "utf8").then((source) => {
|
|
925
|
-
const
|
|
1277
|
+
const component = farmComponentKind(file);
|
|
1278
|
+
const hash = createHash("sha1").update(
|
|
1279
|
+
component ? `${component}\0` : file.endsWith(".tsx") ? "tsx\0" : file.endsWith(".ts") ? "ts\0" : "jsx\0"
|
|
1280
|
+
).update(source).digest("hex");
|
|
926
1281
|
let result = cache.modules[hash];
|
|
927
1282
|
if (result) cached += 1;
|
|
928
1283
|
else {
|
|
929
|
-
result = analyzeSource(file, source, parseSync);
|
|
1284
|
+
result = component ? analyzeComponentSource(file, source, parseSync) : analyzeSource(file, source, parseSync);
|
|
930
1285
|
parsed += 1;
|
|
931
1286
|
}
|
|
932
1287
|
used[hash] = result;
|
|
@@ -990,7 +1345,7 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
990
1345
|
}
|
|
991
1346
|
};
|
|
992
1347
|
}
|
|
993
|
-
if (!
|
|
1348
|
+
if (!isModuleFile(file)) {
|
|
994
1349
|
return {
|
|
995
1350
|
fact,
|
|
996
1351
|
blocker: {
|
|
@@ -1027,8 +1382,7 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
1027
1382
|
const scripts = /* @__PURE__ */ new Set();
|
|
1028
1383
|
for (const { page, layouts } of entries.values()) {
|
|
1029
1384
|
for (const file of [page, ...layouts]) {
|
|
1030
|
-
if (file &&
|
|
1031
|
-
scripts.add(file);
|
|
1385
|
+
if (file && isModuleFile(file)) scripts.add(file);
|
|
1032
1386
|
}
|
|
1033
1387
|
}
|
|
1034
1388
|
await Promise.all([...scripts].map(visitModule));
|
|
@@ -1059,6 +1413,7 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
1059
1413
|
const tags = /* @__PURE__ */ new Set();
|
|
1060
1414
|
const graph = [];
|
|
1061
1415
|
const layoutClasses = /* @__PURE__ */ new Set();
|
|
1416
|
+
const componentSheets = [];
|
|
1062
1417
|
const walk = (file, entry, layout) => {
|
|
1063
1418
|
if (seen.has(file)) return;
|
|
1064
1419
|
seen.add(file);
|
|
@@ -1109,10 +1464,26 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
1109
1464
|
}
|
|
1110
1465
|
if (moduleFacts.serverBoundary && !entry) return;
|
|
1111
1466
|
for (const blocker of moduleFacts.blockers) add({ file: label, ...blocker });
|
|
1467
|
+
for (const action of moduleFacts.formActions ?? []) {
|
|
1468
|
+
const target = action.source === void 0 ? void 0 : (resolved.get(file) ?? []).find((entry2) => entry2.fact.source === action.source)?.file;
|
|
1469
|
+
const server = options.serverComponents === true && (action.source === void 0 || target !== void 0 && settled.get(target)?.serverBoundary === true);
|
|
1470
|
+
if (!server) {
|
|
1471
|
+
add({
|
|
1472
|
+
file: label,
|
|
1473
|
+
line: action.line,
|
|
1474
|
+
column: action.column,
|
|
1475
|
+
rule: "form-action",
|
|
1476
|
+
message: action.message
|
|
1477
|
+
});
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1112
1480
|
if (!layout) {
|
|
1113
1481
|
for (const appClass of moduleFacts.appClasses)
|
|
1114
1482
|
appClasses.push({ file: label, ...appClass });
|
|
1115
1483
|
for (const tag of moduleFacts.tags) tags.add(tag);
|
|
1484
|
+
for (const css of moduleFacts.styles ?? []) {
|
|
1485
|
+
componentSheets.push(parseFarmNativeStylesheet(css));
|
|
1486
|
+
}
|
|
1116
1487
|
}
|
|
1117
1488
|
for (const win of moduleFacts.wins) wins.add(win);
|
|
1118
1489
|
elements.total += moduleFacts.elements.total;
|
|
@@ -1155,7 +1526,7 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
1155
1526
|
ir.root = `${relative2(root, page)}#default`;
|
|
1156
1527
|
}
|
|
1157
1528
|
for (const layout of layouts) walk(layout, true, true);
|
|
1158
|
-
const sheets = [...stylesheets].map(readStylesheet);
|
|
1529
|
+
const sheets = [...[...stylesheets].map(readStylesheet), ...componentSheets];
|
|
1159
1530
|
for (const appClass of appClasses) {
|
|
1160
1531
|
const { styled, problems } = inspectFarmNativeStylesheets(sheets, { class: appClass.name });
|
|
1161
1532
|
const at = { file: appClass.file, line: appClass.line, column: appClass.column };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteRenderingOptions, D as DirectiveRenderingConfig, a as RouteRenderingConfig } from './route-rendering.d-
|
|
2
|
-
import { i as RouteModule, b6 as SSGCollectionResult, b7 as SSGPage } from './client-plugins.d-
|
|
1
|
+
import { R as RouteRenderingOptions, D as DirectiveRenderingConfig, a as RouteRenderingConfig } from './route-rendering.d-D_2Ual0-.mjs';
|
|
2
|
+
import { i as RouteModule, b6 as SSGCollectionResult, b7 as SSGPage } from './client-plugins.d-D4-6hNx7.mjs';
|
|
3
3
|
import { F as FarmIslandStrategy } from './island.d-CfGru1MO.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteRenderingOptions, D as DirectiveRenderingConfig, a as RouteRenderingConfig } from './route-rendering.d-
|
|
2
|
-
import { i as RouteModule, b6 as SSGCollectionResult, b7 as SSGPage } from './client-plugins.d-
|
|
1
|
+
import { R as RouteRenderingOptions, D as DirectiveRenderingConfig, a as RouteRenderingConfig } from './route-rendering.d-BTUYCIj4.js';
|
|
2
|
+
import { i as RouteModule, b6 as SSGCollectionResult, b7 as SSGPage } from './client-plugins.d-CXElzotB.js';
|
|
3
3
|
import { F as FarmIslandStrategy } from './island.d-CfGru1MO.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1236,7 +1236,14 @@ declare function matchesFarmMarkdownRoutePattern(pattern: string, pathname: stri
|
|
|
1236
1236
|
* @internal A rendered page as a reader sees it, whole: streamed Suspense content in place, and
|
|
1237
1237
|
* scripts, styles, comments, and hidden elements removed. The native tier reads pages this way too.
|
|
1238
1238
|
*/
|
|
1239
|
-
|
|
1239
|
+
/**
|
|
1240
|
+
* The rendered page's markup: streamed boundaries in place, without scripts, styles, comments, or
|
|
1241
|
+
* hidden elements. `aria-hidden` content goes too unless `keepAriaHidden`: the Markdown mirror
|
|
1242
|
+
* reads what a screen reader gets, while the native tree draws what a browser shows.
|
|
1243
|
+
*/
|
|
1244
|
+
declare function _readFarmRenderedHtml(html: string, options?: {
|
|
1245
|
+
keepAriaHidden?: boolean;
|
|
1246
|
+
}): string;
|
|
1240
1247
|
interface FarmPageFormOption {
|
|
1241
1248
|
value: string;
|
|
1242
1249
|
label?: string;
|
|
@@ -1236,7 +1236,14 @@ declare function matchesFarmMarkdownRoutePattern(pattern: string, pathname: stri
|
|
|
1236
1236
|
* @internal A rendered page as a reader sees it, whole: streamed Suspense content in place, and
|
|
1237
1237
|
* scripts, styles, comments, and hidden elements removed. The native tier reads pages this way too.
|
|
1238
1238
|
*/
|
|
1239
|
-
|
|
1239
|
+
/**
|
|
1240
|
+
* The rendered page's markup: streamed boundaries in place, without scripts, styles, comments, or
|
|
1241
|
+
* hidden elements. `aria-hidden` content goes too unless `keepAriaHidden`: the Markdown mirror
|
|
1242
|
+
* reads what a screen reader gets, while the native tree draws what a browser shows.
|
|
1243
|
+
*/
|
|
1244
|
+
declare function _readFarmRenderedHtml(html: string, options?: {
|
|
1245
|
+
keepAriaHidden?: boolean;
|
|
1246
|
+
}): string;
|
|
1240
1247
|
interface FarmPageFormOption {
|
|
1241
1248
|
value: string;
|
|
1242
1249
|
label?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { b as FarmClientHydrationCompleteEvent, d as FarmClientHydrationEvent, e as FarmClientHydrationMode, f as FarmClientHydrationSession, g as FarmClientLocation, h as FarmClientNavigationAction, i as FarmClientNavigationErrorEvent, j as FarmClientNavigationEvent, k as FarmClientNavigationLoadedEvent, l as FarmClientNavigationResolvedEvent, m as FarmClientNavigationSession, n as FarmClientPerformanceEvent, a as FarmClientPlugin, o as FarmClientPluginCloseEvent, p as FarmClientPluginEnforce, q as FarmClientPluginErrorEvent, r as FarmClientPluginErrorPhase, F as FarmClientPluginManager, s as FarmClientPluginManagerOptions, t as FarmClientPluginMetadata, u as FarmClientPluginRegistration, v as FarmClientPluginRouter, w as FarmClientPluginSetupEvent, x as FarmClientPluginStateEvent, c as createClientPluginManager } from './lifecycle.d-C2aLBOwu.mjs';
|
|
2
|
-
export { F as FarmPlugin, u as FarmPluginContext, ao as FarmRequestPluginContext, ap as FarmRequestStore } from './client-plugins.d-
|
|
2
|
+
export { F as FarmPlugin, u as FarmPluginContext, ao as FarmRequestPluginContext, ap as FarmRequestStore } from './client-plugins.d-D4-6hNx7.mjs';
|
|
3
3
|
import './route.d-BaVH3V0w.mjs';
|
|
4
4
|
import './endpoint.d-BkMSCRf6.mjs';
|
|
5
5
|
import './cache.mjs';
|
package/dist/client-plugins.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { b as FarmClientHydrationCompleteEvent, d as FarmClientHydrationEvent, e as FarmClientHydrationMode, f as FarmClientHydrationSession, g as FarmClientLocation, h as FarmClientNavigationAction, i as FarmClientNavigationErrorEvent, j as FarmClientNavigationEvent, k as FarmClientNavigationLoadedEvent, l as FarmClientNavigationResolvedEvent, m as FarmClientNavigationSession, n as FarmClientPerformanceEvent, a as FarmClientPlugin, o as FarmClientPluginCloseEvent, p as FarmClientPluginEnforce, q as FarmClientPluginErrorEvent, r as FarmClientPluginErrorPhase, F as FarmClientPluginManager, s as FarmClientPluginManagerOptions, t as FarmClientPluginMetadata, u as FarmClientPluginRegistration, v as FarmClientPluginRouter, w as FarmClientPluginSetupEvent, x as FarmClientPluginStateEvent, c as createClientPluginManager } from './lifecycle.d-C2aLBOwu.js';
|
|
2
|
-
export { F as FarmPlugin, u as FarmPluginContext, ao as FarmRequestPluginContext, ap as FarmRequestStore } from './client-plugins.d-
|
|
2
|
+
export { F as FarmPlugin, u as FarmPluginContext, ao as FarmRequestPluginContext, ap as FarmRequestStore } from './client-plugins.d-CXElzotB.js';
|
|
3
3
|
import './route.d-DBTEqifW.js';
|
|
4
4
|
import './endpoint.d-BgHn0lhl.js';
|
|
5
5
|
import './cache.js';
|
package/dist/client.d.mts
CHANGED
|
@@ -8,11 +8,11 @@ export { a as FarmClientCacheEntry, b as FarmClientCacheKey, F as FarmClientCach
|
|
|
8
8
|
export { F as FarmIntegrationAPI, e as FarmIntegrationAPIBodyFormat, f as FarmIntegrationAPIMethod, g as FarmIntegrationAPIOperation, h as FarmIntegrationAPIResponseFormat, p as api, r as defineIntegrationAPI, s as defineIntegrationAPIOperation, t as endpoint } from './route.d-BaVH3V0w.mjs';
|
|
9
9
|
export { UseThemeResult, useTheme } from './theme/client.mjs';
|
|
10
10
|
import { FarmRouterPathParams, FarmRouterPathParam, FarmRouterBuildOptions } from './router.mjs';
|
|
11
|
-
import { f as FarmViewTransitionMode } from './spa-router.d-
|
|
12
|
-
export { b as FarmNavigateOptions, c as FarmNavigationBlocker, F as FarmNavigationBlockerContext, d as FarmNavigationListener, e as FarmNavigationLocation, a as FarmNavigationState, S as SPARouter, g as getRouter, n as navigateTo, p as prefetch, h as pushState, r as readPageState, i as replaceState } from './spa-router.d-
|
|
11
|
+
import { f as FarmViewTransitionMode } from './spa-router.d-WU_qS5gJ.mjs';
|
|
12
|
+
export { b as FarmNavigateOptions, c as FarmNavigationBlocker, F as FarmNavigationBlockerContext, d as FarmNavigationListener, e as FarmNavigationLocation, a as FarmNavigationState, S as SPARouter, g as getRouter, n as navigateTo, p as prefetch, h as pushState, r as readPageState, i as replaceState } from './spa-router.d-WU_qS5gJ.mjs';
|
|
13
13
|
import { c as FarmI18nLocale } from './types.d-C41ePjvP.mjs';
|
|
14
|
-
export { U as UseBlockerOptions, a as UseBlockerReturn, b as UseRouterOptions, u as useBlocker, c as useNavigation, d as usePageState, e as useRouter, f as useScrollRestoration } from './router.d-
|
|
15
|
-
export { F as FarmNavigationDelegate, a as FarmNavigationDelegateContext, d as delegateNavigation } from './navigation-delegate.d-
|
|
14
|
+
export { U as UseBlockerOptions, a as UseBlockerReturn, b as UseRouterOptions, u as useBlocker, c as useNavigation, d as usePageState, e as useRouter, f as useScrollRestoration } from './router.d-Cuv1jntg.mjs';
|
|
15
|
+
export { F as FarmNavigationDelegate, a as FarmNavigationDelegateContext, d as delegateNavigation } from './navigation-delegate.d-DQVYKoaZ.mjs';
|
|
16
16
|
export { F as FarmChunkRecoveryOptions, i as installChunkErrorRecovery, a as isChunkLoadError } from './chunk-recovery.d-lnQFzcQP.mjs';
|
|
17
17
|
export { b as FarmClientHydrationCompleteEvent, d as FarmClientHydrationEvent, e as FarmClientHydrationMode, f as FarmClientHydrationSession, g as FarmClientLocation, h as FarmClientNavigationAction, i as FarmClientNavigationErrorEvent, j as FarmClientNavigationEvent, k as FarmClientNavigationLoadedEvent, l as FarmClientNavigationResolvedEvent, m as FarmClientNavigationSession, n as FarmClientPerformanceEvent, a as FarmClientPlugin, o as FarmClientPluginCloseEvent, p as FarmClientPluginEnforce, q as FarmClientPluginErrorEvent, r as FarmClientPluginErrorPhase, F as FarmClientPluginManager, s as FarmClientPluginManagerOptions, t as FarmClientPluginMetadata, u as FarmClientPluginRegistration, v as FarmClientPluginRouter, w as FarmClientPluginSetupEvent, x as FarmClientPluginStateEvent, c as createClientPluginManager } from './lifecycle.d-C2aLBOwu.mjs';
|
|
18
18
|
export { S as ServerQueryFetchOptions, f as fetchServerQuery, p as prefetchServerQuery } from './server-query-runtime.d-aP52iuL5.mjs';
|
|
@@ -22,7 +22,7 @@ import './server-fn.mjs';
|
|
|
22
22
|
import './server-fn-error.d-DrcH9cc1.mjs';
|
|
23
23
|
import './server-query.mjs';
|
|
24
24
|
import './types.d-DQnyD3VD.mjs';
|
|
25
|
-
import './client-plugins.d-
|
|
25
|
+
import './client-plugins.d-D4-6hNx7.mjs';
|
|
26
26
|
import './renderer.mjs';
|
|
27
27
|
import './deployment.mjs';
|
|
28
28
|
import 'http';
|
|
@@ -46,7 +46,7 @@ import './image-config.d-CeDgNyX4.mjs';
|
|
|
46
46
|
import './config.d-qt-mE8O5.mjs';
|
|
47
47
|
import './font.mjs';
|
|
48
48
|
import './island.d-CfGru1MO.mjs';
|
|
49
|
-
import './render-plan.d-
|
|
49
|
+
import './render-plan.d-CcF0MeCf.mjs';
|
|
50
50
|
|
|
51
51
|
type MutationStatus = "idle" | "pending" | "success" | "error";
|
|
52
52
|
type AnyMutationTarget = (...args: any[]) => Promise<any>;
|