@farm.js/core 0.2.2 → 0.2.4
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.d-gI3ahrF6.d.mts → agent-mcp.d-CaJJsAVy.d.mts} +1 -1
- package/dist/{agent-mcp.d-DuZjglYX.d.ts → agent-mcp.d-klsG_XKS.d.ts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/{analyzer-UXWYUTBK.mjs → analyzer-CY7BS4GB.mjs} +2 -2
- package/dist/analyzer-KHCOL6JF.cjs +17 -0
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- package/dist/api/route-manager.cjs +4 -4
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +3 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.cjs +5 -5
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/api.mjs +4 -4
- package/dist/{app-manifest.d-bHK9EGPI.d.mts → app-manifest.d-BIdn8Whr.d.mts} +1 -1
- package/dist/{app-manifest.d-B3h89j6a.d.ts → app-manifest.d-DkIbmExG.d.ts} +1 -1
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/{app.d-C3uyET_L.d.ts → app.d-DhZ61V9X.d.ts} +8 -5
- package/dist/{app.d-Cr7fXGvJ.d.mts → app.d-DnqxbvCI.d.mts} +8 -5
- package/dist/{chunk-YOVSWY2E.mjs → chunk-2XDRRAAD.mjs} +1 -1
- package/dist/{chunk-2T4GGCQT.cjs → chunk-6UBGXEIH.cjs} +2 -2
- package/dist/{chunk-BEAQVRMQ.cjs → chunk-76ES7BCO.cjs} +80 -75
- package/dist/{chunk-TK2JJCP5.mjs → chunk-7FNKBP3J.mjs} +186 -29
- package/dist/{chunk-ST3U7XVO.mjs → chunk-7IM2MKRK.mjs} +1 -1
- package/dist/{chunk-GL4SPJTE.cjs → chunk-7Q6KUXH6.cjs} +58 -27
- package/dist/{chunk-5CG2UD6B.cjs → chunk-AMSX2U4D.cjs} +304 -7
- package/dist/{chunk-NPR6SCEV.mjs → chunk-AOSZIHL7.mjs} +1 -1
- package/dist/chunk-APVJJCMB.mjs +547 -0
- package/dist/{chunk-LQZXCSYG.mjs → chunk-B6K2ZM3C.mjs} +5 -3
- package/dist/{chunk-IEXZMDF4.mjs → chunk-BCIUG6EQ.mjs} +2 -2
- package/dist/{chunk-JCERO6YF.mjs → chunk-BUIZTM3Q.mjs} +1 -1
- package/dist/{chunk-SJQ24IB5.cjs → chunk-BY5VQ57W.cjs} +11 -11
- package/dist/{chunk-GKDOKES3.mjs → chunk-CQ5LVPBL.mjs} +1 -1
- package/dist/{chunk-Q4FHYBFT.cjs → chunk-CSCORWIQ.cjs} +11 -11
- package/dist/{chunk-6VMBLDWY.mjs → chunk-CV7C75LN.mjs} +1 -1
- package/dist/{chunk-CZMMU3FP.mjs → chunk-D4DAL7KK.mjs} +35 -4
- package/dist/{chunk-ZVT2F3JU.mjs → chunk-DR65XXXD.mjs} +2 -2
- package/dist/{chunk-PRKFECGT.cjs → chunk-DZWX7FDX.cjs} +6 -4
- package/dist/{chunk-A4AYTO2E.cjs → chunk-EZRB5N6S.cjs} +1 -1
- package/dist/{chunk-B7CZ7T2I.cjs → chunk-JEJXSTYR.cjs} +2 -2
- package/dist/{chunk-56F4CDKE.cjs → chunk-JRPCCBGL.cjs} +449 -291
- package/dist/{chunk-JM5VSEYC.cjs → chunk-KHTDVXXR.cjs} +2 -2
- package/dist/{chunk-PYPHM7AS.cjs → chunk-LH7S7FI3.cjs} +5 -1
- package/dist/{chunk-ZND5D4IC.cjs → chunk-LJZZDRD5.cjs} +363 -326
- package/dist/{chunk-WXPY5FRF.cjs → chunk-P2PF5FUW.cjs} +2 -2
- package/dist/{chunk-CPL7WIMP.mjs → chunk-P3UT3OLV.mjs} +2 -2
- package/dist/{chunk-PZ5ZJAAO.mjs → chunk-POCWXRXW.mjs} +1 -1
- package/dist/{chunk-L7Z6OAE2.cjs → chunk-PVR63WHW.cjs} +4 -4
- package/dist/{chunk-Z23OCU33.cjs → chunk-RF3VCNV7.cjs} +6 -6
- package/dist/{chunk-5AOARZJT.cjs → chunk-T2VXOAC3.cjs} +4 -4
- package/dist/{chunk-FEWGKBMM.mjs → chunk-UIBCPZFO.mjs} +85 -48
- package/dist/{chunk-MYJPW4XN.mjs → chunk-UKGAP2OK.mjs} +3 -3
- package/dist/{chunk-DZXD6CYJ.mjs → chunk-V2RXBDV6.mjs} +4 -0
- package/dist/{chunk-ALGAGXWB.mjs → chunk-XEOIZ4QC.mjs} +1 -1
- package/dist/{chunk-D2VLHRBN.cjs → chunk-Y3MTKPLN.cjs} +4 -4
- package/dist/{chunk-FDS6U2NT.cjs → chunk-Y7FLPQSL.cjs} +3 -3
- package/dist/{chunk-MEXGQE4T.mjs → chunk-YR7ZI57S.mjs} +17 -12
- package/dist/{client-component.d-BavTzqsn.d.ts → client-component.d-BHE9Ns8s.d.ts} +1 -1
- package/dist/{client-component.d-X3j9FOZ2.d.mts → client-component.d-uya-qDZu.d.mts} +1 -1
- package/dist/{client-plugins.d-DnnAopKG.d.mts → client-plugins.d-CqFAvu-W.d.mts} +38 -1
- package/dist/{client-plugins.d-CqTr5IrQ.d.ts → client-plugins.d-Dp89a9Gf.d.ts} +38 -1
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.d.mts +7 -7
- package/dist/client.d.ts +7 -7
- 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-RFVGDHXH.mjs → devtools-CRZCFRRL.mjs} +1 -1
- package/dist/{devtools-4LMM3DDJ.cjs → devtools-ZHYYPMZ3.cjs} +2 -2
- package/dist/docs.cjs +3 -3
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +2 -2
- package/dist/environment/vite.cjs +4 -4
- package/dist/environment/vite.mjs +3 -3
- package/dist/{handler.d-BSlpYCDB.d.mts → handler.d-BgJGywnq.d.mts} +1 -1
- package/dist/{handler.d-DgX7gPO6.d.ts → handler.d-DHxaRQr7.d.ts} +1 -1
- package/dist/{headers.d-CmxW42R2.d.ts → headers.d-DVm2BMtR.d.ts} +1 -1
- package/dist/{headers.d-Cf8l5LMo.d.mts → headers.d-QrzpChrN.d.mts} +1 -1
- package/dist/index.cjs +19 -19
- package/dist/{index.d-BZZt7kxO.d.ts → index.d-B8lXhfTs.d.ts} +1 -1
- package/dist/{index.d-7xoJqKRZ.d.mts → index.d-Bpu1TV0-.d.mts} +1 -1
- package/dist/index.d.mts +22 -22
- package/dist/index.d.ts +22 -22
- package/dist/index.mjs +18 -18
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/build-runtime.cjs +18 -18
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +17 -17
- package/dist/internal/cli-runtime.cjs +7 -7
- package/dist/internal/cli-runtime.d.mts +7 -7
- package/dist/internal/cli-runtime.d.ts +7 -7
- package/dist/internal/cli-runtime.mjs +6 -6
- 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 +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +3 -3
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +2 -2
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -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 +4 -4
- package/dist/internal/production-runtime.d.mts +10 -10
- package/dist/internal/production-runtime.d.ts +10 -10
- package/dist/internal/production-runtime.mjs +3 -3
- package/dist/internal/spa-router.d.mts +3 -3
- package/dist/internal/spa-router.d.ts +3 -3
- package/dist/internal/start-manifest.d.mts +1 -1
- package/dist/internal/start-manifest.d.ts +1 -1
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/{mount.d-CD-xVBu7.d.ts → mount.d-Cw_75kb9.d.ts} +1 -1
- package/dist/{mount.d-Dd0xeRMl.d.mts → mount.d-CyfNKOHK.d.mts} +1 -1
- package/dist/{navigation-delegate.d-Bses_F-y.d.ts → navigation-delegate.d--imR0rY7.d.ts} +1 -1
- package/dist/{navigation-delegate.d-dBNg976E.d.mts → navigation-delegate.d-DVEtyGYw.d.mts} +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 +5 -5
- package/dist/plugin.d.ts +5 -5
- package/dist/plugin.mjs +12 -12
- package/dist/{render-plan.d-vOdZHHLI.d.mts → render-plan.d-CTehM6y8.d.mts} +1 -1
- package/dist/{render-plan.d-DaIwnRK2.d.ts → render-plan.d-DpxLd_1i.d.ts} +1 -1
- package/dist/renderer-client.d.mts +5 -5
- package/dist/renderer-client.d.ts +5 -5
- package/dist/{request.d-CgXp3EEc.d.ts → request.d-BFXzOr32.d.ts} +1 -1
- package/dist/{request.d-B8U4pVFP.d.mts → request.d-BmQzlKtT.d.mts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-Di0AxFix.d.ts → route-rendering.d-bEil1VkF.d.ts} +1 -1
- package/dist/{route-rendering.d-BQvNYQqu.d.mts → route-rendering.d-geg68qd0.d.mts} +1 -1
- package/dist/{router.d-BJVGhSAJ.d.ts → router.d-4OCT2ak5.d.ts} +1 -1
- package/dist/{router.d-hNedVdoB.d.mts → router.d-CQjEcNih.d.mts} +1 -1
- package/dist/routes.cjs +3 -3
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.mjs +2 -2
- package/dist/{rsc-pipeline-NCJ3NIE5.mjs → rsc-pipeline-JISGZS6G.mjs} +2 -2
- package/dist/{rsc-pipeline-HT4G3QGT.cjs → rsc-pipeline-R5W3PAAL.cjs} +3 -3
- package/dist/{runtime-6UF5XKUP.cjs → runtime-HSTND4FF.cjs} +8 -8
- package/dist/{runtime-VHXIEXL7.mjs → runtime-I2SBIB2Q.mjs} +5 -5
- package/dist/{runtime.d-0R8nHCM6.d.ts → runtime.d-BKoa6J55.d.ts} +1 -1
- package/dist/{runtime.d-DpeuF_T-.d.mts → runtime.d-DjYo5E1n.d.mts} +1 -1
- package/dist/{schema-dependencies.d-_Wyey4Wv.d.mts → schema-dependencies.d-CGNgsyKS.d.mts} +1 -1
- package/dist/{schema-dependencies.d-tkUHREqz.d.ts → schema-dependencies.d-CRoN2Q9N.d.ts} +1 -1
- package/dist/{server-components-status.d-sN7ju-ie.d.mts → server-components-status.d-Crl3IonP.d.mts} +1 -1
- package/dist/{server-components-status.d-B2Z5WvO5.d.ts → server-components-status.d-CwfcQD6n.d.ts} +1 -1
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server.cjs +34 -34
- package/dist/server.d.mts +11 -11
- package/dist/server.d.ts +11 -11
- package/dist/server.mjs +14 -14
- package/dist/{spa-router.d-MjT6sGb9.d.ts → spa-router.d-Bv-r3AAK.d.ts} +2 -2
- package/dist/{spa-router.d-D3AtR2Bc.d.mts → spa-router.d-DhO_PJHP.d.mts} +2 -2
- package/dist/{ssg.d-C1SNuPz5.d.ts → ssg.d-CzFOAkqy.d.mts} +13 -2
- package/dist/{ssg.d-B32Cp_XW.d.mts → ssg.d-SfEQfMsA.d.ts} +13 -2
- package/dist/{store-core.d-BZ3YXs70.d.ts → store-core.d-Ch0N8dni.d.ts} +2 -2
- package/dist/{store-core.d-BbVdaoA0.d.mts → store-core.d-pKJCUdTR.d.mts} +2 -2
- package/dist/testing.cjs +5 -5
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +4 -4
- package/dist/{utils.d-Bjbm44fP.d.ts → utils.d-BaLODLrK.d.ts} +1 -1
- package/dist/{utils.d-CoLozp7-.d.mts → utils.d-TPjb_Q7w.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 +6 -6
- package/dist/vite.d.ts +6 -6
- package/dist/vite.mjs +12 -12
- package/package.json +2 -2
- package/dist/analyzer-ENHO4SA5.cjs +0 -17
- package/dist/chunk-Q4CPBKPT.mjs +0 -251
- /package/dist/{chunk-JL2HNLMC.mjs → chunk-3QC2XTCN.mjs} +0 -0
- /package/dist/{chunk-COXMHCIV.cjs → chunk-GDKJGL7D.cjs} +0 -0
|
@@ -25,13 +25,13 @@ var _chunk32HGOX3Mcjs = require('./chunk-32HGOX3M.cjs');
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _chunkLH7S7FI3cjs = require('./chunk-LH7S7FI3.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
var _chunk7ZDLE77Pcjs = require('./chunk-7ZDLE77P.cjs');
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunkEZRB5N6Scjs = require('./chunk-EZRB5N6S.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
var _chunkUGL4BDNBcjs = require('./chunk-UGL4BDNB.cjs');
|
|
@@ -980,7 +980,7 @@ function usePackageScanCacheFile(file) {
|
|
|
980
980
|
const stored = /* @__PURE__ */ new Map();
|
|
981
981
|
try {
|
|
982
982
|
const value = JSON.parse(_fs2.default.readFileSync(file, "utf8"));
|
|
983
|
-
if (_optionalChain([value, 'optionalAccess', _68 => _68.schema]) === PACKAGE_SCAN_CACHE_SCHEMA && value.farm ===
|
|
983
|
+
if (_optionalChain([value, 'optionalAccess', _68 => _68.schema]) === PACKAGE_SCAN_CACHE_SCHEMA && value.farm === _chunkEZRB5N6Scjs.FARM_VERSION && value.scans && typeof value.scans === "object") {
|
|
984
984
|
for (const [directory, scan] of Object.entries(value.scans)) {
|
|
985
985
|
if (isStoredPackageScan(scan)) stored.set(directory, scan);
|
|
986
986
|
}
|
|
@@ -1009,7 +1009,7 @@ function persistPackageScanCache() {
|
|
|
1009
1009
|
_fs2.default.mkdirSync(_path2.default.dirname(cache2.file), { recursive: true });
|
|
1010
1010
|
_fs2.default.writeFileSync(
|
|
1011
1011
|
temporary,
|
|
1012
|
-
JSON.stringify({ schema: PACKAGE_SCAN_CACHE_SCHEMA, farm:
|
|
1012
|
+
JSON.stringify({ schema: PACKAGE_SCAN_CACHE_SCHEMA, farm: _chunkEZRB5N6Scjs.FARM_VERSION, scans })
|
|
1013
1013
|
);
|
|
1014
1014
|
_fs2.default.renameSync(temporary, cache2.file);
|
|
1015
1015
|
cache2.dirty = false;
|
|
@@ -1234,7 +1234,7 @@ function resolveProgrammaticClientRoutes(options) {
|
|
|
1234
1234
|
let untraced = false;
|
|
1235
1235
|
const definedIn = /* @__PURE__ */ new Map();
|
|
1236
1236
|
for (const route of definitions) {
|
|
1237
|
-
const source =
|
|
1237
|
+
const source = _chunkLH7S7FI3cjs.getProgrammaticRouteDefinitionSource.call(void 0, route);
|
|
1238
1238
|
const callers = (_nullishCoalesce(_optionalChain([source, 'optionalAccess', _85 => _85.stacks]), () => ( []))).map((stack) => findRouteCallers(stack, modulesByFile));
|
|
1239
1239
|
for (const caller of callers.flat()) caller.routeSource = true;
|
|
1240
1240
|
definedIn.set(route, callers.flat());
|
|
@@ -2322,7 +2322,7 @@ var PackageClientBoundaryCache = class {
|
|
|
2322
2322
|
}
|
|
2323
2323
|
const contents = JSON.stringify({
|
|
2324
2324
|
schema: SCHEMA_VERSION,
|
|
2325
|
-
farm:
|
|
2325
|
+
farm: _chunkEZRB5N6Scjs.FARM_VERSION,
|
|
2326
2326
|
paths,
|
|
2327
2327
|
entries
|
|
2328
2328
|
});
|
|
@@ -2362,7 +2362,7 @@ function readStoredCache(file) {
|
|
|
2362
2362
|
} catch (e38) {
|
|
2363
2363
|
return null;
|
|
2364
2364
|
}
|
|
2365
|
-
if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !==
|
|
2365
|
+
if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !== _chunkEZRB5N6Scjs.FARM_VERSION) {
|
|
2366
2366
|
return null;
|
|
2367
2367
|
}
|
|
2368
2368
|
const { paths, entries } = value;
|
|
@@ -2373,7 +2373,7 @@ function readStoredCache(file) {
|
|
|
2373
2373
|
const usable = variants.filter((entry) => isStoredEntry(entry, paths.length));
|
|
2374
2374
|
if (usable.length > 0) valid[key] = usable;
|
|
2375
2375
|
}
|
|
2376
|
-
return { schema: SCHEMA_VERSION, farm:
|
|
2376
|
+
return { schema: SCHEMA_VERSION, farm: _chunkEZRB5N6Scjs.FARM_VERSION, paths, entries: valid };
|
|
2377
2377
|
}
|
|
2378
2378
|
function isRecord(value) {
|
|
2379
2379
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -4737,7 +4737,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
4737
4737
|
sources = void 0;
|
|
4738
4738
|
routesFiles = new Set(
|
|
4739
4739
|
_chunkPFVNPOKNcjs.getFarmSourceRoots.call(void 0, { ...options, root: _nullishCoalesce(options.root, () => ( config.root)) }).flatMap(
|
|
4740
|
-
(source) =>
|
|
4740
|
+
(source) => _chunkLH7S7FI3cjs.PROGRAMMATIC_ROUTE_FILE_NAMES.map(
|
|
4741
4741
|
(name) => resolvedFile(_path2.default.resolve(source.root, source.srcDir, name))
|
|
4742
4742
|
)
|
|
4743
4743
|
)
|
|
@@ -4756,7 +4756,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
4756
4756
|
parse: parse3,
|
|
4757
4757
|
componentExtensions
|
|
4758
4758
|
});
|
|
4759
|
-
if (environment === "client" && !isBuild && !
|
|
4759
|
+
if (environment === "client" && !isBuild && !_chunkLH7S7FI3cjs.parseProgrammaticRouteModuleId.call(void 0, id) && routeSourceFiles().has(moduleFile(id)) && !isProgrammaticRouteActionProxy(code)) {
|
|
4760
4760
|
this.error(routeSourceError(moduleFile(id)));
|
|
4761
4761
|
}
|
|
4762
4762
|
if (environment === "server" && _chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, options)) === "islands" && isApplicationScript(id)) {
|
|
@@ -4791,7 +4791,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
4791
4791
|
if (resolveBuildEnvironment(context, false) !== "client") return;
|
|
4792
4792
|
const forbidden = routeSourceFiles();
|
|
4793
4793
|
for (const id of this.getModuleIds()) {
|
|
4794
|
-
if (
|
|
4794
|
+
if (_chunkLH7S7FI3cjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
4795
4795
|
const chain = findClientNodeBuiltinChain(id, (moduleId) => {
|
|
4796
4796
|
return _optionalChain([this, 'access', _285 => _285.getModuleInfo, 'call', _286 => _286(moduleId), 'optionalAccess', _287 => _287.importedIds]);
|
|
4797
4797
|
});
|
|
@@ -9,10 +9,10 @@ var _chunkIVEV44O2cjs = require('./chunk-IVEV44O2.cjs');
|
|
|
9
9
|
var _chunkKSRWTQ6Jcjs = require('./chunk-KSRWTQ6J.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkY3MTKPLNcjs = require('./chunk-Y3MTKPLN.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkDZWX7FDXcjs = require('./chunk-DZWX7FDX.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -30,7 +30,7 @@ var _chunkYCGOQKVCcjs = require('./chunk-YCGOQKVC.cjs');
|
|
|
30
30
|
var _chunk5P3TZGS3cjs = require('./chunk-5P3TZGS3.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
33
|
+
var _chunkLH7S7FI3cjs = require('./chunk-LH7S7FI3.cjs');
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
var _chunkCH2JX3CMcjs = require('./chunk-CH2JX3CM.cjs');
|
|
@@ -156,7 +156,7 @@ function farmApiPlugin(options = {}) {
|
|
|
156
156
|
const existing = apiRoutesCache.get(routePath);
|
|
157
157
|
const existingFile = _optionalChain([endpointSources, 'access', _4 => _4.get, 'call', _5 => _5(routePath), 'optionalAccess', _6 => _6.get, 'call', _7 => _7(normalizedMethod)]);
|
|
158
158
|
if (existingFile) {
|
|
159
|
-
throw new (0,
|
|
159
|
+
throw new (0, _chunkY3MTKPLNcjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
|
|
160
160
|
}
|
|
161
161
|
if (existing) {
|
|
162
162
|
if (!existing.methods.includes(normalizedMethod)) {
|
|
@@ -332,7 +332,7 @@ function farmApiPlugin(options = {}) {
|
|
|
332
332
|
log(`API route discovered: ${availableMethods.join(", ")} ${routePath}`);
|
|
333
333
|
}
|
|
334
334
|
} catch (e) {
|
|
335
|
-
if (e instanceof
|
|
335
|
+
if (e instanceof _chunkY3MTKPLNcjs.APIRouteConflictError || e instanceof _chunkT4YCWRCJcjs.AmbiguousRouteError) throw e;
|
|
336
336
|
log(`API route load failed at ${filePath}: ${e.message}`);
|
|
337
337
|
}
|
|
338
338
|
}
|
|
@@ -359,7 +359,7 @@ function farmApiPlugin(options = {}) {
|
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
361
|
} catch (e) {
|
|
362
|
-
if (e instanceof
|
|
362
|
+
if (e instanceof _chunkY3MTKPLNcjs.APIRouteConflictError || e instanceof _chunkT4YCWRCJcjs.AmbiguousRouteError) throw e;
|
|
363
363
|
log(`Root routes.ts load failed: ${e.message}`);
|
|
364
364
|
}
|
|
365
365
|
break;
|
|
@@ -369,7 +369,7 @@ function farmApiPlugin(options = {}) {
|
|
|
369
369
|
const discoverProgrammaticRoutes = async () => {
|
|
370
370
|
const path = await import("path");
|
|
371
371
|
const srcRoot = path.join(server.config.root, srcDir);
|
|
372
|
-
const routeFiles =
|
|
372
|
+
const routeFiles = _chunkDZWX7FDXcjs.findProgrammaticRouteFilesInDir.call(void 0, srcRoot);
|
|
373
373
|
if (routeFiles.length === 0) return;
|
|
374
374
|
const { getProgrammaticRouteManifest } = await import("./routes.cjs");
|
|
375
375
|
for (const routeFile of routeFiles) {
|
|
@@ -390,7 +390,7 @@ function farmApiPlugin(options = {}) {
|
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
} catch (e) {
|
|
393
|
-
if (e instanceof
|
|
393
|
+
if (e instanceof _chunkY3MTKPLNcjs.APIRouteConflictError || e instanceof _chunkT4YCWRCJcjs.AmbiguousRouteError) throw e;
|
|
394
394
|
log(`Programmatic routes file load failed at ${routeFile}: ${e.message}`);
|
|
395
395
|
}
|
|
396
396
|
}
|
|
@@ -579,7 +579,7 @@ function farmApiPlugin(options = {}) {
|
|
|
579
579
|
async handleHotUpdate({ file, server, modules }) {
|
|
580
580
|
const normalizedFile = _chunk7ZDLE77Pcjs.toPosixPath.call(void 0, file);
|
|
581
581
|
const fileName = normalizedFile.split("/").pop() || "";
|
|
582
|
-
if (fileName === "routes.ts" || fileName === "routes.tsx" || fileName === "routes.js" ||
|
|
582
|
+
if (fileName === "routes.ts" || fileName === "routes.tsx" || fileName === "routes.js" || _chunkLH7S7FI3cjs.isProgrammaticRoutesFileName.call(void 0, fileName)) {
|
|
583
583
|
log(`Root routes file updated: ${fileName}`);
|
|
584
584
|
for (const mod of modules) {
|
|
585
585
|
server.moduleGraph.invalidateModule(mod);
|
|
@@ -615,7 +615,7 @@ function farmApiPlugin(options = {}) {
|
|
|
615
615
|
log(`API router recreated`);
|
|
616
616
|
} catch (e) {
|
|
617
617
|
restoreRouteState(previousState);
|
|
618
|
-
if (e instanceof
|
|
618
|
+
if (e instanceof _chunkY3MTKPLNcjs.APIRouteConflictError || e instanceof _chunkT4YCWRCJcjs.AmbiguousRouteError) throw e;
|
|
619
619
|
log(`Root routes.ts HMR failed: ${e.message}`);
|
|
620
620
|
}
|
|
621
621
|
return [];
|
|
@@ -653,7 +653,7 @@ function farmApiPlugin(options = {}) {
|
|
|
653
653
|
log(`API router recreated`);
|
|
654
654
|
} catch (e) {
|
|
655
655
|
restoreRouteState(previousState);
|
|
656
|
-
if (e instanceof
|
|
656
|
+
if (e instanceof _chunkY3MTKPLNcjs.APIRouteConflictError || e instanceof _chunkT4YCWRCJcjs.AmbiguousRouteError) throw e;
|
|
657
657
|
log(`API route HMR failed: ${e.message}`);
|
|
658
658
|
}
|
|
659
659
|
return [];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRouteTypeDeclarations,
|
|
3
3
|
generateRouteTypes
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-POCWXRXW.mjs";
|
|
5
5
|
import {
|
|
6
6
|
APITypeGenerator
|
|
7
7
|
} from "./chunk-WRT775N6.mjs";
|
|
@@ -95,7 +95,10 @@ function analyzeStaticRouteCandidate(mod, source, options = {}) {
|
|
|
95
95
|
if (options.isDynamic && !listsStaticPaths(mod)) {
|
|
96
96
|
blockers.push("the route has dynamic path segments");
|
|
97
97
|
}
|
|
98
|
-
if (hasExplicitRenderingConfig(
|
|
98
|
+
if (hasExplicitRenderingConfig(
|
|
99
|
+
options.dynamicAutoIsUnset && mod?.dynamic === "auto" ? { ...mod, dynamic: void 0 } : mod,
|
|
100
|
+
source
|
|
101
|
+
)) {
|
|
99
102
|
blockers.push("the route already has explicit rendering config");
|
|
100
103
|
}
|
|
101
104
|
if (source) {
|
|
@@ -417,6 +420,7 @@ function skipHorizontalWhitespace(source, start) {
|
|
|
417
420
|
async function collectSSGPages(routes, loadModule, options = {}) {
|
|
418
421
|
const ssgPages = [];
|
|
419
422
|
const ssrRoutes = [];
|
|
423
|
+
const staticCandidates = [];
|
|
420
424
|
const staticCandidateRoutes = [];
|
|
421
425
|
let staticCandidateDocsPages = 0;
|
|
422
426
|
for (const route of routes) {
|
|
@@ -471,7 +475,12 @@ async function collectSSGPages(routes, loadModule, options = {}) {
|
|
|
471
475
|
}
|
|
472
476
|
} else {
|
|
473
477
|
ssrRoutes.push(route.path);
|
|
474
|
-
if (options.
|
|
478
|
+
if (options.staticCandidates && !options.docsAdapterRoutes?.owns(route.path) && analyzeStaticRouteCandidate(mod, source, {
|
|
479
|
+
isDynamic: route.isDynamic,
|
|
480
|
+
dynamicAutoIsUnset: true
|
|
481
|
+
}).candidate) {
|
|
482
|
+
staticCandidates.push(...await listStaticCandidatePages(route, mod));
|
|
483
|
+
} else if (options.suggestStaticRendering !== false && analyzeStaticRouteCandidate(mod, source, { isDynamic: route.isDynamic }).candidate) {
|
|
475
484
|
if (options.docsAdapterRoutes?.owns(route.path)) staticCandidateDocsPages += 1;
|
|
476
485
|
else staticCandidateRoutes.push(route.path);
|
|
477
486
|
}
|
|
@@ -497,7 +506,29 @@ Add \`export const dynamic = "force-static";\` after verifying that imported cod
|
|
|
497
506
|
`[Farm.js] ${staticCandidateDocsPages} docs page${staticCandidateDocsPages === 1 ? " renders" : "s render"} on each request. Set \`docs.prerender: true\` in farm.config.ts to prerender docs pages on Node and serverless targets.`
|
|
498
507
|
);
|
|
499
508
|
}
|
|
500
|
-
return {
|
|
509
|
+
return {
|
|
510
|
+
ssg: ssgPages,
|
|
511
|
+
ssr: ssrRoutes,
|
|
512
|
+
...options.staticCandidates ? { staticCandidates } : {}
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
async function listStaticCandidatePages(route, mod) {
|
|
516
|
+
if (!route.isDynamic) return [{ urlPath: route.path, filePath: route.filePath, params: {} }];
|
|
517
|
+
try {
|
|
518
|
+
const getStaticPaths = mod.getStaticPaths || mod.generateStaticParams;
|
|
519
|
+
const paths = getStaticPaths ? await getStaticPaths() : [];
|
|
520
|
+
const optionalCatchAllParams = getOptionalCatchAllParameterNames(route.path);
|
|
521
|
+
return paths.map((params) => ({
|
|
522
|
+
urlPath: materializeSSGRoutePath(route.path, params),
|
|
523
|
+
filePath: route.filePath,
|
|
524
|
+
params: normalizeStaticPathParams(params, optionalCatchAllParams)
|
|
525
|
+
}));
|
|
526
|
+
} catch (error) {
|
|
527
|
+
console.warn(
|
|
528
|
+
`[Farm.js] experimental.staticPages: keeping "${route.path}" server-handled because listing its params failed: ${error instanceof Error ? error.message : String(error)}`
|
|
529
|
+
);
|
|
530
|
+
return [];
|
|
531
|
+
}
|
|
501
532
|
}
|
|
502
533
|
function isSSGModule(mod) {
|
|
503
534
|
return resolveRouteRenderingConfig(mod).ssg;
|
|
@@ -25,13 +25,13 @@ import {
|
|
|
25
25
|
PROGRAMMATIC_ROUTE_FILE_NAMES,
|
|
26
26
|
getProgrammaticRouteDefinitionSource,
|
|
27
27
|
parseProgrammaticRouteModuleId
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-V2RXBDV6.mjs";
|
|
29
29
|
import {
|
|
30
30
|
logger
|
|
31
31
|
} from "./chunk-U6GMCDRS.mjs";
|
|
32
32
|
import {
|
|
33
33
|
FARM_VERSION
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-CV7C75LN.mjs";
|
|
35
35
|
|
|
36
36
|
// src/environment-vite.ts
|
|
37
37
|
import { existsSync, readFileSync, realpathSync } from "fs";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
var _chunkLH7S7FI3cjs = require('./chunk-LH7S7FI3.cjs');
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
var _chunkUGL4BDNBcjs = require('./chunk-UGL4BDNB.cjs');
|
|
@@ -29,7 +30,7 @@ function findProgrammaticRouteFiles(root, srcDir = "src") {
|
|
|
29
30
|
}
|
|
30
31
|
function findProgrammaticRouteFilesInDir(srcRoot) {
|
|
31
32
|
const files = [];
|
|
32
|
-
for (const fileName of
|
|
33
|
+
for (const fileName of _chunkLH7S7FI3cjs.PROGRAMMATIC_ROUTE_FILE_NAMES) {
|
|
33
34
|
const filePath = _path.join.call(void 0, srcRoot, fileName);
|
|
34
35
|
if (_fs.existsSync.call(void 0, filePath)) {
|
|
35
36
|
files.push(filePath);
|
|
@@ -45,7 +46,7 @@ async function discoverProgrammaticRoutePaths(root, srcDir = "src") {
|
|
|
45
46
|
]);
|
|
46
47
|
for (const filePath of files) {
|
|
47
48
|
const source = _fs.readFileSync.call(void 0, filePath, "utf8");
|
|
48
|
-
for (const routePath of
|
|
49
|
+
for (const routePath of _chunkLH7S7FI3cjs.scanProgrammaticPagePaths.call(void 0, source)) {
|
|
49
50
|
paths.add(routePath);
|
|
50
51
|
}
|
|
51
52
|
}
|
|
@@ -57,7 +58,7 @@ async function findProgrammaticRouteSourceFiles(srcRoot) {
|
|
|
57
58
|
}
|
|
58
59
|
try {
|
|
59
60
|
const { glob } = await import("tinyglobby");
|
|
60
|
-
|
|
61
|
+
const files = await glob("**/*.{ts,tsx,js,jsx}", {
|
|
61
62
|
cwd: srcRoot,
|
|
62
63
|
absolute: true,
|
|
63
64
|
expandDirectories: false,
|
|
@@ -70,6 +71,7 @@ async function findProgrammaticRouteSourceFiles(srcRoot) {
|
|
|
70
71
|
"lib/api.generated.ts"
|
|
71
72
|
]
|
|
72
73
|
});
|
|
74
|
+
return files.filter((file) => !_chunkLH7S7FI3cjs.isTestSourceFile.call(void 0, _path.relative.call(void 0, srcRoot, file)));
|
|
73
75
|
} catch (e) {
|
|
74
76
|
return [];
|
|
75
77
|
}
|
|
@@ -18,7 +18,7 @@ var _chunk4A6WSOZHcjs = require('./chunk-4A6WSOZH.cjs');
|
|
|
18
18
|
var _chunkTDAH76RRcjs = require('./chunk-TDAH76RR.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkGDKJGL7Dcjs = require('./chunk-GDKJGL7D.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -638,7 +638,7 @@ async function resolveAPIContext(options) {
|
|
|
638
638
|
config: options.config,
|
|
639
639
|
configPath: options.configPath
|
|
640
640
|
}));
|
|
641
|
-
const docs = isResolvedDocsConfig(docsInput) ? docsInput : await
|
|
641
|
+
const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkGDKJGL7Dcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
|
|
642
642
|
const guardedPaths = new Set(_nullishCoalesce(_optionalChain([runtimeConfig, 'optionalAccess', _27 => _27.guardedPaths]), () => ( [])));
|
|
643
643
|
return {
|
|
644
644
|
root,
|