@farm.js/core 0.1.15 → 0.1.17
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-runtime.d.mts +5 -2
- package/dist/agent-runtime.d.ts +5 -2
- package/dist/api/client.cjs +62 -28
- package/dist/api/client.d.mts +3 -2
- package/dist/api/client.d.ts +3 -2
- package/dist/api/client.mjs +3 -3
- package/dist/api/route-manager.cjs +69 -32
- package/dist/api/route-manager.d.mts +5 -2
- package/dist/api/route-manager.d.ts +5 -2
- package/dist/api/route-manager.mjs +5 -5
- package/dist/api/runtime.cjs +65 -29
- package/dist/api/runtime.d.mts +3 -2
- package/dist/api/runtime.d.ts +3 -2
- package/dist/api/runtime.mjs +6 -3
- package/dist/{api-client-C8d7BZNp.d.mts → api-client-Cx54IR5g.d.mts} +2 -1
- package/dist/{api-client-BWrEbxfO.d.ts → api-client-DykpaKcY.d.ts} +2 -1
- package/dist/api.cjs +106 -33
- package/dist/api.d.mts +7 -4
- package/dist/api.d.ts +7 -4
- package/dist/api.mjs +8 -8
- package/dist/{app-wIYse61b.d.ts → app-BHY_10Lm.d.ts} +3 -3
- package/dist/{app-B3nVSjen.d.mts → app-BMk0do23.d.mts} +3 -3
- package/dist/app-markdown.d.mts +6 -3
- package/dist/app-markdown.d.ts +6 -3
- package/dist/app-markdown.mjs +3 -3
- package/dist/cache.cjs +62 -28
- package/dist/cache.d.mts +11 -1
- package/dist/cache.d.ts +11 -1
- package/dist/cache.mjs +1 -1
- package/dist/{chunk-FOGLGRDS.mjs → chunk-4OOBRCJX.mjs} +122 -8
- package/dist/{chunk-JRF3C33L.mjs → chunk-56DAX2BE.mjs} +172 -53
- package/dist/{chunk-B76DT5Y6.mjs → chunk-57J3Y7Y3.mjs} +1 -1
- package/dist/{chunk-MOQNHLTS.mjs → chunk-5QOEPUYE.mjs} +5 -2
- package/dist/{chunk-HKLRP3BN.mjs → chunk-5SPPCN5J.mjs} +1 -1
- package/dist/{chunk-LUC2FAGW.mjs → chunk-6VQIKZZO.mjs} +1 -1
- package/dist/{chunk-7ZWL7XOU.mjs → chunk-76DG3LF3.mjs} +1 -1
- package/dist/{chunk-EWDK36MM.mjs → chunk-A72YEUZ3.mjs} +1 -1
- package/dist/{chunk-ZHOIQC6U.mjs → chunk-ATERBVHQ.mjs} +2 -2
- package/dist/{chunk-27JNCYEK.mjs → chunk-EN7WTEAY.mjs} +2 -2
- package/dist/{chunk-IGO2HEV7.mjs → chunk-F6SJAKFJ.mjs} +62 -28
- package/dist/{chunk-GSDIZACQ.mjs → chunk-FG5H2VCJ.mjs} +2 -2
- package/dist/{chunk-LZK5CXDW.mjs → chunk-KLSSO6YD.mjs} +2 -2
- package/dist/{chunk-KUO3GBPK.mjs → chunk-L6V3P73N.mjs} +1 -1
- package/dist/{chunk-FBHGHMOA.mjs → chunk-MVIWBEJF.mjs} +37 -27
- package/dist/{chunk-KTGFMHET.mjs → chunk-N6UROPT7.mjs} +1 -1
- package/dist/{chunk-NDD2YVGU.mjs → chunk-NRVGEI5I.mjs} +10 -3
- package/dist/{chunk-GNTPTTLA.mjs → chunk-QGVJVSNX.mjs} +5 -5
- package/dist/{chunk-6SCB2MXB.mjs → chunk-SXHV42UQ.mjs} +16 -1
- package/dist/{chunk-OWTIOHON.mjs → chunk-SYGGPS4A.mjs} +2 -2
- package/dist/{chunk-NC333MFA.mjs → chunk-TSWW5BVH.mjs} +7 -4
- package/dist/{chunk-LK6FGAQR.mjs → chunk-UDBJCUPA.mjs} +7 -4
- package/dist/{chunk-NJ47VORC.mjs → chunk-UTBVHYS3.mjs} +2 -2
- package/dist/{chunk-76MNRHTS.mjs → chunk-UUYF3CHN.mjs} +2 -2
- package/dist/{chunk-S3QW3BIS.mjs → chunk-WD4YXVLV.mjs} +99 -6
- package/dist/{chunk-W7IVHTOP.mjs → chunk-WD5PNSOB.mjs} +16 -3
- package/dist/{chunk-DPZUDPVJ.mjs → chunk-XP777LRD.mjs} +1 -1
- package/dist/{chunk-KATQ6I56.mjs → chunk-XWAYMDLB.mjs} +1 -1
- package/dist/{chunk-UE75PB52.mjs → chunk-YD4J4XCI.mjs} +1 -1
- package/dist/{chunk-Q3MDL7TM.mjs → chunk-ZCNJKLA2.mjs} +30 -11
- package/dist/{client-plugins-CslwYp3E.d.ts → client-plugins-C089bQhN.d.ts} +16 -4
- package/dist/{client-plugins-C1EgdoJM.d.mts → client-plugins-JXXmZliS.d.mts} +16 -4
- package/dist/client-plugins.d.mts +5 -2
- package/dist/client-plugins.d.ts +5 -2
- package/dist/client.cjs +62 -28
- package/dist/client.d.mts +8 -7
- package/dist/client.d.ts +8 -7
- package/dist/client.mjs +6 -6
- package/dist/config.d.mts +5 -2
- package/dist/config.d.ts +5 -2
- package/dist/cron.mjs +2 -2
- package/dist/{devtools-PCGEBRSC.mjs → devtools-UFVTMQX5.mjs} +7 -7
- package/dist/docs.cjs +83 -4
- package/dist/docs.mjs +9 -9
- package/dist/{route-CHBaW55F.d.ts → endpoint-1zA994xL.d.ts} +3 -128
- package/dist/{route-C6UClI1z.d.mts → endpoint-DAc96i93.d.mts} +3 -128
- package/dist/env.cjs +135 -8
- package/dist/env.d.mts +22 -2
- package/dist/env.d.ts +22 -2
- package/dist/env.mjs +4 -1
- package/dist/index.cjs +516 -105
- package/dist/index.d.mts +16 -15
- package/dist/index.d.ts +16 -15
- package/dist/index.mjs +46 -34
- package/dist/integrations.d.mts +5 -2
- package/dist/integrations.d.ts +5 -2
- package/dist/internal/app-markdown-runtime.d.mts +5 -2
- package/dist/internal/app-markdown-runtime.d.ts +5 -2
- package/dist/internal/app-markdown-runtime.mjs +2 -2
- package/dist/internal/build-runtime.cjs +600 -284
- package/dist/internal/build-runtime.d.mts +7 -4
- package/dist/internal/build-runtime.d.ts +7 -4
- package/dist/internal/build-runtime.mjs +23 -23
- package/dist/internal/cli-runtime.cjs +143 -33
- package/dist/internal/cli-runtime.mjs +13 -13
- package/dist/internal/client-error-overlay.cjs +1 -1
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/compression-runtime.d.mts +5 -2
- package/dist/internal/compression-runtime.d.ts +5 -2
- package/dist/internal/config-runtime.cjs +80 -4
- package/dist/internal/config-runtime.d.mts +6 -3
- package/dist/internal/config-runtime.d.ts +6 -3
- package/dist/internal/config-runtime.mjs +7 -7
- package/dist/internal/product-telemetry-runtime.cjs +1 -1
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +101 -41
- package/dist/internal/production-runtime.d.mts +11 -8
- package/dist/internal/production-runtime.d.ts +11 -8
- package/dist/internal/production-runtime.mjs +6 -6
- package/dist/markdown.cjs +16 -1
- package/dist/markdown.mjs +1 -1
- package/dist/{metadata-BsUcOEXg.d.ts → metadata-BcNJP4fq.d.ts} +1 -1
- package/dist/{metadata-B1bxCPUY.d.mts → metadata-C1Z9vLbb.d.mts} +1 -1
- package/dist/middleware.cjs +10 -3
- package/dist/middleware.d.mts +7 -4
- package/dist/middleware.d.ts +7 -4
- package/dist/middleware.mjs +4 -4
- package/dist/{nitro-ICBP5APY.mjs → nitro-CVZ36JM5.mjs} +8 -5
- package/dist/plugin.cjs +358 -106
- package/dist/plugin.d.mts +5 -2
- package/dist/plugin.d.ts +5 -2
- package/dist/plugin.mjs +19 -19
- package/dist/{production-runtime-BDllolVh.d.mts → production-runtime-jcrTlRTb.d.mts} +1 -1
- package/dist/{production-runtime-CsNn2-zx.d.ts → production-runtime-oKmC0WU-.d.ts} +1 -1
- package/dist/{render-plan-CNUlzylR.d.mts → render-plan-BLIfc4jt.d.mts} +1 -1
- package/dist/{render-plan-EG4hNFjy.d.ts → render-plan-DOB9cV-h.d.ts} +1 -1
- package/dist/renderer-client.cjs +62 -28
- package/dist/renderer-client.d.mts +5 -4
- package/dist/renderer-client.d.ts +5 -4
- package/dist/renderer-client.mjs +3 -3
- package/dist/{request-Blh_f7Z3.d.mts → request-Cr53NRHr.d.mts} +1 -1
- package/dist/{request-DsVSQVfD.d.ts → request-Dt2gNuQD.d.ts} +1 -1
- package/dist/request.d.mts +6 -3
- package/dist/request.d.ts +6 -3
- package/dist/route-B0XrsrFk.d.mts +128 -0
- package/dist/route-DOEpbyWZ.d.ts +128 -0
- package/dist/{route-rendering-hUETRCbM.d.ts → route-rendering-CWYd8Mv1.d.ts} +1 -1
- package/dist/{route-rendering-LT4XSoQK.d.mts → route-rendering-CeFBEAoZ.d.mts} +1 -1
- package/dist/routes.cjs +68 -31
- package/dist/routes.d.mts +5 -3
- package/dist/routes.d.ts +5 -3
- package/dist/routes.mjs +2 -2
- package/dist/server-fn-client.d.mts +3 -2
- package/dist/server-fn-client.d.ts +3 -2
- package/dist/server-fn.cjs +212 -32
- package/dist/server-fn.d.mts +72 -1
- package/dist/server-fn.d.ts +72 -1
- package/dist/server-fn.mjs +13 -2
- package/dist/server-plugins.d.mts +6 -3
- package/dist/server-plugins.d.ts +6 -3
- package/dist/server-query-client.cjs +62 -28
- package/dist/server-query-client.d.mts +1 -0
- package/dist/server-query-client.d.ts +1 -0
- package/dist/server-query-client.mjs +4 -4
- package/dist/server-query.cjs +131 -32
- package/dist/server-query.d.mts +6 -1
- package/dist/server-query.d.ts +6 -1
- package/dist/server-query.mjs +4 -3
- package/dist/server.cjs +393 -84
- package/dist/server.d.mts +9 -8
- package/dist/server.d.ts +9 -8
- package/dist/server.mjs +22 -22
- package/dist/{spa-router-csKR9Ebj.d.mts → spa-router-CQWiYGxS.d.mts} +2 -2
- package/dist/{spa-router-Y_2FSJQK.d.ts → spa-router-Wjiw-8hB.d.ts} +2 -2
- package/dist/testing.cjs +73 -32
- package/dist/testing.d.mts +5 -3
- package/dist/testing.d.ts +5 -3
- package/dist/testing.mjs +11 -7
- package/dist/{utils-jISOE9SD.d.ts → utils-B0XJmG_b.d.ts} +1 -1
- package/dist/{utils-DR2wfZAn.d.mts → utils-uUxF0K0P.d.mts} +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +500 -252
- package/dist/vite.d.mts +5 -2
- package/dist/vite.d.ts +5 -2
- package/dist/vite.mjs +19 -19
- package/dist/workflows.mjs +2 -2
- package/package.json +2 -2
- package/dist/{chunk-VO5SCWF5.mjs → chunk-BNGS6KJ6.mjs} +0 -0
- package/dist/{chunk-MUUZJLCI.mjs → chunk-EGJDUF4Q.mjs} +3 -3
- package/dist/{chunk-4L7SZOHZ.mjs → chunk-YHOCRI4H.mjs} +3 -3
package/dist/client.cjs
CHANGED
|
@@ -1617,6 +1617,8 @@ var _FarmDataCache = class _FarmDataCache {
|
|
|
1617
1617
|
constructor(config = {}) {
|
|
1618
1618
|
this.entries = /* @__PURE__ */ new Map();
|
|
1619
1619
|
this.inflight = /* @__PURE__ */ new Map();
|
|
1620
|
+
/** Local entries by tag, so tag counts and pruning never scan unrelated entries. */
|
|
1621
|
+
this.entriesByTag = /* @__PURE__ */ new Map();
|
|
1620
1622
|
this.invalidatedTagVersions = /* @__PURE__ */ new Map();
|
|
1621
1623
|
this.activeGenerations = /* @__PURE__ */ new Set();
|
|
1622
1624
|
this.version = 0;
|
|
@@ -1635,6 +1637,7 @@ var _FarmDataCache = class _FarmDataCache {
|
|
|
1635
1637
|
configure(config = {}) {
|
|
1636
1638
|
this.generation++;
|
|
1637
1639
|
this.entries.clear();
|
|
1640
|
+
this.entriesByTag.clear();
|
|
1638
1641
|
this.inflight.clear();
|
|
1639
1642
|
this.invalidatedTagVersions.clear();
|
|
1640
1643
|
this.activeGenerations.clear();
|
|
@@ -1801,14 +1804,12 @@ var _FarmDataCache = class _FarmDataCache {
|
|
|
1801
1804
|
return entry;
|
|
1802
1805
|
}
|
|
1803
1806
|
delete(key) {
|
|
1804
|
-
const deleted = this.
|
|
1805
|
-
if (deleted) this.pruneInvalidatedTagVersions();
|
|
1807
|
+
const deleted = this.deleteLocalEntry(key);
|
|
1806
1808
|
emitFarmEvent({ type: "cache.delete", key, deleted });
|
|
1807
1809
|
return deleted;
|
|
1808
1810
|
}
|
|
1809
1811
|
async deleteAsync(key) {
|
|
1810
|
-
const deleted = this.
|
|
1811
|
-
if (deleted) this.pruneInvalidatedTagVersions();
|
|
1812
|
+
const deleted = this.deleteLocalEntry(key);
|
|
1812
1813
|
if (this.adapter) {
|
|
1813
1814
|
await this.adapter.delete(this.createAdapterKey(key));
|
|
1814
1815
|
}
|
|
@@ -1819,6 +1820,7 @@ var _FarmDataCache = class _FarmDataCache {
|
|
|
1819
1820
|
const count = this.entries.size;
|
|
1820
1821
|
this.generation++;
|
|
1821
1822
|
this.entries.clear();
|
|
1823
|
+
this.entriesByTag.clear();
|
|
1822
1824
|
this.inflight.clear();
|
|
1823
1825
|
this.invalidatedTagVersions.clear();
|
|
1824
1826
|
this.activeGenerations.clear();
|
|
@@ -1904,23 +1906,32 @@ var _FarmDataCache = class _FarmDataCache {
|
|
|
1904
1906
|
return cached.value;
|
|
1905
1907
|
}
|
|
1906
1908
|
const inflight = this.inflight.get(key);
|
|
1907
|
-
if (inflight) {
|
|
1909
|
+
if (inflight && !this.wasInvalidatedSince(inflight.tags, inflight.startVersion)) {
|
|
1908
1910
|
emitFarmEvent({ type: "cache.dedupe", key });
|
|
1909
|
-
return inflight;
|
|
1911
|
+
return inflight.promise;
|
|
1910
1912
|
}
|
|
1911
1913
|
const tags = Array.from(normalizeCacheOptionsTags(options));
|
|
1912
1914
|
const generation = this.generation;
|
|
1915
|
+
const startVersion = this.version;
|
|
1913
1916
|
const promise = this.fillCacheEntry(key, producer, options, tags, generation).catch((error) => {
|
|
1914
1917
|
emitFarmEvent({ type: "cache.error", key, operation: "set", error });
|
|
1915
1918
|
throw error;
|
|
1916
1919
|
}).finally(() => {
|
|
1917
|
-
if (this.inflight.get(key) === promise) {
|
|
1920
|
+
if (this.inflight.get(key)?.promise === promise) {
|
|
1918
1921
|
this.inflight.delete(key);
|
|
1919
1922
|
}
|
|
1920
1923
|
});
|
|
1921
|
-
this.inflight.set(key, promise);
|
|
1924
|
+
this.inflight.set(key, { promise, tags, startVersion });
|
|
1922
1925
|
return promise;
|
|
1923
1926
|
}
|
|
1927
|
+
/** A fill that started before one of its tags was invalidated cannot satisfy later readers. */
|
|
1928
|
+
wasInvalidatedSince(tags, version) {
|
|
1929
|
+
for (const tag of tags) {
|
|
1930
|
+
const invalidatedVersion = this.invalidatedTagVersions.get(tag);
|
|
1931
|
+
if (invalidatedVersion !== void 0 && invalidatedVersion > version) return true;
|
|
1932
|
+
}
|
|
1933
|
+
return false;
|
|
1934
|
+
}
|
|
1924
1935
|
async fillCacheEntry(key, producer, options, tags, generation) {
|
|
1925
1936
|
const adapter = this.adapter;
|
|
1926
1937
|
const namespace = this.namespace;
|
|
@@ -1961,7 +1972,7 @@ var _FarmDataCache = class _FarmDataCache {
|
|
|
1961
1972
|
return value;
|
|
1962
1973
|
} finally {
|
|
1963
1974
|
this.activeGenerations.delete(activeGeneration);
|
|
1964
|
-
this.pruneInvalidatedTagVersions();
|
|
1975
|
+
this.pruneInvalidatedTagVersions(activeGeneration.tags);
|
|
1965
1976
|
if (leaseToken && adapter?.releaseLease) {
|
|
1966
1977
|
try {
|
|
1967
1978
|
await adapter.releaseLease(leaseKey, leaseToken);
|
|
@@ -2006,18 +2017,9 @@ var _FarmDataCache = class _FarmDataCache {
|
|
|
2006
2017
|
}
|
|
2007
2018
|
return void 0;
|
|
2008
2019
|
}
|
|
2009
|
-
countEntriesForTag(tag) {
|
|
2010
|
-
let count = 0;
|
|
2011
|
-
for (const entry of this.entries.values()) {
|
|
2012
|
-
if (entry.tags.has(tag)) {
|
|
2013
|
-
count++;
|
|
2014
|
-
}
|
|
2015
|
-
}
|
|
2016
|
-
return count;
|
|
2017
|
-
}
|
|
2018
2020
|
countEntriesForTags(tags) {
|
|
2019
2021
|
let count = 0;
|
|
2020
|
-
for (const entry of this.
|
|
2022
|
+
for (const entry of this.entriesByTag.get(tags[0]) ?? []) {
|
|
2021
2023
|
if (tags.every((tag) => entry.tags.has(tag))) {
|
|
2022
2024
|
count++;
|
|
2023
2025
|
}
|
|
@@ -2025,10 +2027,10 @@ var _FarmDataCache = class _FarmDataCache {
|
|
|
2025
2027
|
return count;
|
|
2026
2028
|
}
|
|
2027
2029
|
invalidateTag(normalizedTag) {
|
|
2028
|
-
const count = this.
|
|
2030
|
+
const count = this.entriesByTag.get(normalizedTag)?.size ?? 0;
|
|
2029
2031
|
this.invalidatedTagVersions.delete(normalizedTag);
|
|
2030
2032
|
this.invalidatedTagVersions.set(normalizedTag, ++this.version);
|
|
2031
|
-
this.pruneInvalidatedTagVersions();
|
|
2033
|
+
this.pruneInvalidatedTagVersions([normalizedTag]);
|
|
2032
2034
|
return count;
|
|
2033
2035
|
}
|
|
2034
2036
|
toPublicEntry(entry) {
|
|
@@ -2058,19 +2060,51 @@ var _FarmDataCache = class _FarmDataCache {
|
|
|
2058
2060
|
this.entries.set(key, entry);
|
|
2059
2061
|
}
|
|
2060
2062
|
storeLocalEntry(entry) {
|
|
2061
|
-
|
|
2063
|
+
const removed = [];
|
|
2064
|
+
const replaced = this.detachLocalEntry(entry.key);
|
|
2065
|
+
if (replaced) removed.push(replaced);
|
|
2062
2066
|
this.entries.set(entry.key, entry);
|
|
2067
|
+
for (const tag of entry.tags) {
|
|
2068
|
+
let tagged = this.entriesByTag.get(tag);
|
|
2069
|
+
if (!tagged) this.entriesByTag.set(tag, tagged = /* @__PURE__ */ new Set());
|
|
2070
|
+
tagged.add(entry);
|
|
2071
|
+
}
|
|
2063
2072
|
while (this.entries.size > this.maxEntries) {
|
|
2064
2073
|
const oldestKey = this.entries.keys().next().value;
|
|
2065
2074
|
if (oldestKey === void 0) break;
|
|
2066
|
-
this.
|
|
2075
|
+
removed.push(this.detachLocalEntry(oldestKey));
|
|
2067
2076
|
}
|
|
2068
|
-
this.pruneInvalidatedTagVersions();
|
|
2077
|
+
for (const removedEntry of removed) this.pruneInvalidatedTagVersions(removedEntry.tags);
|
|
2069
2078
|
}
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2079
|
+
deleteLocalEntry(key) {
|
|
2080
|
+
const entry = this.detachLocalEntry(key);
|
|
2081
|
+
if (!entry) return false;
|
|
2082
|
+
this.pruneInvalidatedTagVersions(entry.tags);
|
|
2083
|
+
return true;
|
|
2084
|
+
}
|
|
2085
|
+
detachLocalEntry(key) {
|
|
2086
|
+
const entry = this.entries.get(key);
|
|
2087
|
+
if (!entry) return void 0;
|
|
2088
|
+
this.entries.delete(key);
|
|
2089
|
+
for (const tag of entry.tags) {
|
|
2090
|
+
const tagged = this.entriesByTag.get(tag);
|
|
2091
|
+
if (!tagged) continue;
|
|
2092
|
+
tagged.delete(entry);
|
|
2093
|
+
if (tagged.size === 0) this.entriesByTag.delete(tag);
|
|
2094
|
+
}
|
|
2095
|
+
return entry;
|
|
2096
|
+
}
|
|
2097
|
+
/**
|
|
2098
|
+
* Drop invalidation versions that no local entry or active fill can be stale against.
|
|
2099
|
+
* Callers pass only the tags whose dependents just changed, so the cost is bounded by
|
|
2100
|
+
* the entries sharing those tags rather than by the whole cache.
|
|
2101
|
+
*/
|
|
2102
|
+
pruneInvalidatedTagVersions(tags) {
|
|
2103
|
+
tags: for (const tag of tags) {
|
|
2104
|
+
const invalidatedVersion = this.invalidatedTagVersions.get(tag);
|
|
2105
|
+
if (invalidatedVersion === void 0) continue;
|
|
2106
|
+
for (const entry of this.entriesByTag.get(tag) ?? []) {
|
|
2107
|
+
if (entry.createdVersion < invalidatedVersion) continue tags;
|
|
2074
2108
|
}
|
|
2075
2109
|
for (const generation of this.activeGenerations) {
|
|
2076
2110
|
if (generation.tags.has(tag) && generation.createdVersion < invalidatedVersion)
|
package/dist/client.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as ClientOptions, g as APIResult } from './api-client-
|
|
2
|
-
export { v as APIClient, h as APIClientError, b as APIClientOptions, i as APIClientSystemError, c as APIClientWithoutIntegrationsOptions, x as ApiClients, L as ClientHeaders, M as ClientLifecycleHooks, N as ClientRequestEvent, P as ClientResponseEvent, a9 as InferIntegrationOperationBody, aa as InferIntegrationOperationQuery, ab as InferIntegrationOperationResponse, a5 as IntegrationAPI, a0 as IntegrationClient, a1 as IntegrationClientAliases, a7 as IntegrationClientData, T as IntegrationClientError, a3 as IntegrationClientOptions, a4 as IntegrationClientRequestOptions, a2 as IntegrationClientRoot, a6 as IntegrationClients, a8 as IntegrationOperationResult, ac as IntegrationServerClient, ad as IntegrationServerClientAliases, ae as IntegrationServerClientOptions, af as IntegrationServerClientRequestOptions, ag as IntegrationServerClientRoot, ah as IntegrationServerRequestLike, u as RouteAPIClient, w as ServerAPIClient, S as ServerAPIClientOptions, d as ServerAPIClientWithoutIntegrationsOptions, z as createAPIClient, y as createApiClients, U as createIntegrationApi, Q as createIntegrationClient, V as createIntegrationClients, X as createIntegrationServerClient, W as createIntegrations, E as createServerAPIClient, Y as getIntegrationAPIManifest, Z as integrationClients, _ as integrationsClient, $ as integrationsServer } from './api-client-
|
|
3
|
-
export {
|
|
1
|
+
import { r as ClientOptions, g as APIResult } from './api-client-Cx54IR5g.mjs';
|
|
2
|
+
export { v as APIClient, h as APIClientError, b as APIClientOptions, i as APIClientSystemError, c as APIClientWithoutIntegrationsOptions, x as ApiClients, L as ClientHeaders, M as ClientLifecycleHooks, N as ClientRequestEvent, P as ClientResponseEvent, a9 as InferIntegrationOperationBody, aa as InferIntegrationOperationQuery, ab as InferIntegrationOperationResponse, a5 as IntegrationAPI, a0 as IntegrationClient, a1 as IntegrationClientAliases, a7 as IntegrationClientData, T as IntegrationClientError, a3 as IntegrationClientOptions, a4 as IntegrationClientRequestOptions, a2 as IntegrationClientRoot, a6 as IntegrationClients, a8 as IntegrationOperationResult, ac as IntegrationServerClient, ad as IntegrationServerClientAliases, ae as IntegrationServerClientOptions, af as IntegrationServerClientRequestOptions, ag as IntegrationServerClientRoot, ah as IntegrationServerRequestLike, u as RouteAPIClient, w as ServerAPIClient, S as ServerAPIClientOptions, d as ServerAPIClientWithoutIntegrationsOptions, z as createAPIClient, y as createApiClients, U as createIntegrationApi, Q as createIntegrationClient, V as createIntegrationClients, X as createIntegrationServerClient, W as createIntegrations, E as createServerAPIClient, Y as getIntegrationAPIManifest, Z as integrationClients, _ as integrationsClient, $ as integrationsServer } from './api-client-Cx54IR5g.mjs';
|
|
3
|
+
export { K as FarmAPIStream } from './endpoint-DAc96i93.mjs';
|
|
4
4
|
import React__default, { ComponentType, FormHTMLAttributes, FormEvent, AnchorHTMLAttributes, RefObject } from 'react';
|
|
5
5
|
export { RouteActionTarget, UseActionFormProps, UseActionReturn, UseServerFnOptions, useAction } from './server-fn-client.mjs';
|
|
6
6
|
export { UseServerQueryOptions, UseServerQueryResult, useServerQuery } from './server-query-client.mjs';
|
|
@@ -8,19 +8,20 @@ export { a as FarmClientCacheEntry, b as FarmClientCacheKey, F as FarmClientCach
|
|
|
8
8
|
export { F as FarmIntegrationAPI, c as FarmIntegrationAPIBodyFormat, e as FarmIntegrationAPIMethod, f as FarmIntegrationAPIOperation, g as FarmIntegrationAPIResponseFormat, a as api, d as defineIntegrationAPI, b as defineIntegrationAPIOperation, i as endpoint } from './integration-api-BbaiokCC.mjs';
|
|
9
9
|
export { UseThemeResult, useTheme } from './theme/client.mjs';
|
|
10
10
|
import { FarmRouterPathParams, FarmRouterPathParam, FarmRouterBuildOptions, FarmRouterRouteInput } from './router.mjs';
|
|
11
|
-
import { i as FarmViewTransitionMode, e as FarmNavigationBlockerContext, F as FarmNavigationState } from './spa-router-
|
|
12
|
-
export { a as FarmNavigateOptions, d as FarmNavigationBlocker, f as FarmNavigationListener, h as FarmNavigationLocation, S as SPARouter, g as getRouter, n as navigateTo, p as prefetch, b as pushState, r as readPageState, c as replaceState } from './spa-router-
|
|
11
|
+
import { i as FarmViewTransitionMode, e as FarmNavigationBlockerContext, F as FarmNavigationState } from './spa-router-CQWiYGxS.mjs';
|
|
12
|
+
export { a as FarmNavigateOptions, d as FarmNavigationBlocker, f as FarmNavigationListener, h as FarmNavigationLocation, S as SPARouter, g as getRouter, n as navigateTo, p as prefetch, b as pushState, r as readPageState, c as replaceState } from './spa-router-CQWiYGxS.mjs';
|
|
13
13
|
import { b as FarmI18nLocale } from './types-Z0aotQ8w.mjs';
|
|
14
14
|
export { F as FarmChunkRecoveryOptions, i as installChunkErrorRecovery, a as isChunkLoadError } from './chunk-recovery-lnQFzcQP.mjs';
|
|
15
15
|
export { a as FarmClientHydrationCompleteEvent, b as FarmClientHydrationEvent, d as FarmClientHydrationMode, e as FarmClientHydrationSession, f as FarmClientLocation, g as FarmClientNavigationAction, h as FarmClientNavigationErrorEvent, i as FarmClientNavigationEvent, j as FarmClientNavigationLoadedEvent, k as FarmClientNavigationResolvedEvent, l as FarmClientNavigationSession, m as FarmClientPerformanceEvent, n 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-DK06VuKP.mjs';
|
|
16
16
|
export { S as ServerQueryFetchOptions, f as fetchServerQuery, p as prefetchServerQuery } from './server-query-runtime-aP52iuL5.mjs';
|
|
17
17
|
export { getTheme, setTheme, toggleTheme } from './theme/runtime.mjs';
|
|
18
18
|
import './cache.mjs';
|
|
19
|
+
import './route-B0XrsrFk.mjs';
|
|
19
20
|
import './server-fn.mjs';
|
|
20
21
|
import './server-fn-error-DDh14a0V.mjs';
|
|
21
22
|
import './server-query.mjs';
|
|
22
23
|
import './types-DQnyD3VD.mjs';
|
|
23
|
-
import './client-plugins-
|
|
24
|
+
import './client-plugins-JXXmZliS.mjs';
|
|
24
25
|
import './renderer.mjs';
|
|
25
26
|
import './deployment.mjs';
|
|
26
27
|
import 'http';
|
|
@@ -46,7 +47,7 @@ import './font.mjs';
|
|
|
46
47
|
import './after.mjs';
|
|
47
48
|
import 'node:http';
|
|
48
49
|
import './island-CfGru1MO.mjs';
|
|
49
|
-
import './render-plan-
|
|
50
|
+
import './render-plan-BLIfc4jt.mjs';
|
|
50
51
|
|
|
51
52
|
type MutationStatus = "idle" | "pending" | "success" | "error";
|
|
52
53
|
type AnyMutationTarget = (...args: any[]) => Promise<any>;
|
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as ClientOptions, g as APIResult } from './api-client-
|
|
2
|
-
export { v as APIClient, h as APIClientError, b as APIClientOptions, i as APIClientSystemError, c as APIClientWithoutIntegrationsOptions, x as ApiClients, L as ClientHeaders, M as ClientLifecycleHooks, N as ClientRequestEvent, P as ClientResponseEvent, a9 as InferIntegrationOperationBody, aa as InferIntegrationOperationQuery, ab as InferIntegrationOperationResponse, a5 as IntegrationAPI, a0 as IntegrationClient, a1 as IntegrationClientAliases, a7 as IntegrationClientData, T as IntegrationClientError, a3 as IntegrationClientOptions, a4 as IntegrationClientRequestOptions, a2 as IntegrationClientRoot, a6 as IntegrationClients, a8 as IntegrationOperationResult, ac as IntegrationServerClient, ad as IntegrationServerClientAliases, ae as IntegrationServerClientOptions, af as IntegrationServerClientRequestOptions, ag as IntegrationServerClientRoot, ah as IntegrationServerRequestLike, u as RouteAPIClient, w as ServerAPIClient, S as ServerAPIClientOptions, d as ServerAPIClientWithoutIntegrationsOptions, z as createAPIClient, y as createApiClients, U as createIntegrationApi, Q as createIntegrationClient, V as createIntegrationClients, X as createIntegrationServerClient, W as createIntegrations, E as createServerAPIClient, Y as getIntegrationAPIManifest, Z as integrationClients, _ as integrationsClient, $ as integrationsServer } from './api-client-
|
|
3
|
-
export {
|
|
1
|
+
import { r as ClientOptions, g as APIResult } from './api-client-DykpaKcY.js';
|
|
2
|
+
export { v as APIClient, h as APIClientError, b as APIClientOptions, i as APIClientSystemError, c as APIClientWithoutIntegrationsOptions, x as ApiClients, L as ClientHeaders, M as ClientLifecycleHooks, N as ClientRequestEvent, P as ClientResponseEvent, a9 as InferIntegrationOperationBody, aa as InferIntegrationOperationQuery, ab as InferIntegrationOperationResponse, a5 as IntegrationAPI, a0 as IntegrationClient, a1 as IntegrationClientAliases, a7 as IntegrationClientData, T as IntegrationClientError, a3 as IntegrationClientOptions, a4 as IntegrationClientRequestOptions, a2 as IntegrationClientRoot, a6 as IntegrationClients, a8 as IntegrationOperationResult, ac as IntegrationServerClient, ad as IntegrationServerClientAliases, ae as IntegrationServerClientOptions, af as IntegrationServerClientRequestOptions, ag as IntegrationServerClientRoot, ah as IntegrationServerRequestLike, u as RouteAPIClient, w as ServerAPIClient, S as ServerAPIClientOptions, d as ServerAPIClientWithoutIntegrationsOptions, z as createAPIClient, y as createApiClients, U as createIntegrationApi, Q as createIntegrationClient, V as createIntegrationClients, X as createIntegrationServerClient, W as createIntegrations, E as createServerAPIClient, Y as getIntegrationAPIManifest, Z as integrationClients, _ as integrationsClient, $ as integrationsServer } from './api-client-DykpaKcY.js';
|
|
3
|
+
export { K as FarmAPIStream } from './endpoint-1zA994xL.js';
|
|
4
4
|
import React__default, { ComponentType, FormHTMLAttributes, FormEvent, AnchorHTMLAttributes, RefObject } from 'react';
|
|
5
5
|
export { RouteActionTarget, UseActionFormProps, UseActionReturn, UseServerFnOptions, useAction } from './server-fn-client.js';
|
|
6
6
|
export { UseServerQueryOptions, UseServerQueryResult, useServerQuery } from './server-query-client.js';
|
|
@@ -8,19 +8,20 @@ export { a as FarmClientCacheEntry, b as FarmClientCacheKey, F as FarmClientCach
|
|
|
8
8
|
export { F as FarmIntegrationAPI, c as FarmIntegrationAPIBodyFormat, e as FarmIntegrationAPIMethod, f as FarmIntegrationAPIOperation, g as FarmIntegrationAPIResponseFormat, a as api, d as defineIntegrationAPI, b as defineIntegrationAPIOperation, i as endpoint } from './integration-api-BbaiokCC.js';
|
|
9
9
|
export { UseThemeResult, useTheme } from './theme/client.js';
|
|
10
10
|
import { FarmRouterPathParams, FarmRouterPathParam, FarmRouterBuildOptions, FarmRouterRouteInput } from './router.js';
|
|
11
|
-
import { i as FarmViewTransitionMode, e as FarmNavigationBlockerContext, F as FarmNavigationState } from './spa-router-
|
|
12
|
-
export { a as FarmNavigateOptions, d as FarmNavigationBlocker, f as FarmNavigationListener, h as FarmNavigationLocation, S as SPARouter, g as getRouter, n as navigateTo, p as prefetch, b as pushState, r as readPageState, c as replaceState } from './spa-router-
|
|
11
|
+
import { i as FarmViewTransitionMode, e as FarmNavigationBlockerContext, F as FarmNavigationState } from './spa-router-Wjiw-8hB.js';
|
|
12
|
+
export { a as FarmNavigateOptions, d as FarmNavigationBlocker, f as FarmNavigationListener, h as FarmNavigationLocation, S as SPARouter, g as getRouter, n as navigateTo, p as prefetch, b as pushState, r as readPageState, c as replaceState } from './spa-router-Wjiw-8hB.js';
|
|
13
13
|
import { b as FarmI18nLocale } from './types-Z0aotQ8w.js';
|
|
14
14
|
export { F as FarmChunkRecoveryOptions, i as installChunkErrorRecovery, a as isChunkLoadError } from './chunk-recovery-lnQFzcQP.js';
|
|
15
15
|
export { a as FarmClientHydrationCompleteEvent, b as FarmClientHydrationEvent, d as FarmClientHydrationMode, e as FarmClientHydrationSession, f as FarmClientLocation, g as FarmClientNavigationAction, h as FarmClientNavigationErrorEvent, i as FarmClientNavigationEvent, j as FarmClientNavigationLoadedEvent, k as FarmClientNavigationResolvedEvent, l as FarmClientNavigationSession, m as FarmClientPerformanceEvent, n 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-DK06VuKP.js';
|
|
16
16
|
export { S as ServerQueryFetchOptions, f as fetchServerQuery, p as prefetchServerQuery } from './server-query-runtime-DXRNhX_3.js';
|
|
17
17
|
export { getTheme, setTheme, toggleTheme } from './theme/runtime.js';
|
|
18
18
|
import './cache.js';
|
|
19
|
+
import './route-DOEpbyWZ.js';
|
|
19
20
|
import './server-fn.js';
|
|
20
21
|
import './server-fn-error-DDh14a0V.js';
|
|
21
22
|
import './server-query.js';
|
|
22
23
|
import './types-DQnyD3VD.js';
|
|
23
|
-
import './client-plugins-
|
|
24
|
+
import './client-plugins-C089bQhN.js';
|
|
24
25
|
import './renderer.js';
|
|
25
26
|
import './deployment.js';
|
|
26
27
|
import 'http';
|
|
@@ -46,7 +47,7 @@ import './font.js';
|
|
|
46
47
|
import './after.js';
|
|
47
48
|
import 'node:http';
|
|
48
49
|
import './island-CfGru1MO.js';
|
|
49
|
-
import './render-plan-
|
|
50
|
+
import './render-plan-DOB9cV-h.js';
|
|
50
51
|
|
|
51
52
|
type MutationStatus = "idle" | "pending" | "success" | "error";
|
|
52
53
|
type AnyMutationTarget = (...args: any[]) => Promise<any>;
|
package/dist/client.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
storageClientCacheAdapter,
|
|
14
14
|
useFetcher,
|
|
15
15
|
useMutation
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-KLSSO6YD.mjs";
|
|
17
17
|
import {
|
|
18
18
|
installChunkErrorRecovery,
|
|
19
19
|
isChunkLoadError
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "./chunk-SHB3GYXI.mjs";
|
|
24
24
|
import {
|
|
25
25
|
useServerQuery
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-FG5H2VCJ.mjs";
|
|
27
27
|
import {
|
|
28
28
|
useBlocker,
|
|
29
29
|
useNavigation,
|
|
@@ -49,12 +49,12 @@ import {
|
|
|
49
49
|
integrationClients,
|
|
50
50
|
integrationsClient,
|
|
51
51
|
integrationsServer
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-L6V3P73N.mjs";
|
|
53
53
|
import "./chunk-72AK62H5.mjs";
|
|
54
54
|
import {
|
|
55
55
|
fetchServerQuery,
|
|
56
56
|
prefetchServerQuery
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-UUYF3CHN.mjs";
|
|
58
58
|
import {
|
|
59
59
|
getTheme,
|
|
60
60
|
setTheme,
|
|
@@ -77,7 +77,7 @@ import "./chunk-5HGR3W6O.mjs";
|
|
|
77
77
|
import {
|
|
78
78
|
getFarmClientDataCache,
|
|
79
79
|
normalizeFarmClientCacheKey
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-5SPPCN5J.mjs";
|
|
81
81
|
import "./chunk-QVYLBY73.mjs";
|
|
82
82
|
import "./chunk-KGB5UXJJ.mjs";
|
|
83
83
|
import {
|
|
@@ -100,7 +100,7 @@ import "./chunk-YS3TRKCG.mjs";
|
|
|
100
100
|
import "./chunk-SKNL7VA2.mjs";
|
|
101
101
|
import "./chunk-2A3EQHXX.mjs";
|
|
102
102
|
import "./chunk-JNZ4TDWM.mjs";
|
|
103
|
-
import "./chunk-
|
|
103
|
+
import "./chunk-F6SJAKFJ.mjs";
|
|
104
104
|
import "./chunk-4SIYUGRY.mjs";
|
|
105
105
|
import "./chunk-C4NCTZLM.mjs";
|
|
106
106
|
import "./chunk-FUZEBRP3.mjs";
|
package/dist/config.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { q as FarmUserConfig } from './client-plugins-
|
|
1
|
+
import { q as FarmUserConfig } from './client-plugins-JXXmZliS.mjs';
|
|
2
2
|
import './lifecycle-DK06VuKP.mjs';
|
|
3
|
-
import './route-
|
|
3
|
+
import './route-B0XrsrFk.mjs';
|
|
4
|
+
import './endpoint-DAc96i93.mjs';
|
|
4
5
|
import './cache.mjs';
|
|
5
6
|
import './renderer.mjs';
|
|
6
7
|
import './deployment.mjs';
|
|
@@ -27,6 +28,8 @@ import './server-fn-error-DDh14a0V.mjs';
|
|
|
27
28
|
import 'esbuild';
|
|
28
29
|
import './image-config-Duob7wER.mjs';
|
|
29
30
|
import './types-Z0aotQ8w.mjs';
|
|
31
|
+
import './server-fn.mjs';
|
|
32
|
+
import './server-query.mjs';
|
|
30
33
|
import './types-DQnyD3VD.mjs';
|
|
31
34
|
import './font.mjs';
|
|
32
35
|
import './after.mjs';
|
package/dist/config.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { q as FarmUserConfig } from './client-plugins-
|
|
1
|
+
import { q as FarmUserConfig } from './client-plugins-C089bQhN.js';
|
|
2
2
|
import './lifecycle-DK06VuKP.js';
|
|
3
|
-
import './route-
|
|
3
|
+
import './route-DOEpbyWZ.js';
|
|
4
|
+
import './endpoint-1zA994xL.js';
|
|
4
5
|
import './cache.js';
|
|
5
6
|
import './renderer.js';
|
|
6
7
|
import './deployment.js';
|
|
@@ -27,6 +28,8 @@ import './server-fn-error-DDh14a0V.js';
|
|
|
27
28
|
import 'esbuild';
|
|
28
29
|
import './image-config-Duob7wER.js';
|
|
29
30
|
import './types-Z0aotQ8w.js';
|
|
31
|
+
import './server-fn.js';
|
|
32
|
+
import './server-query.js';
|
|
30
33
|
import './types-DQnyD3VD.js';
|
|
31
34
|
import './font.js';
|
|
32
35
|
import './after.js';
|
package/dist/cron.mjs
CHANGED
|
@@ -11,9 +11,9 @@ import {
|
|
|
11
11
|
mergeScheduledTasks,
|
|
12
12
|
prepareFarmCronForNitro,
|
|
13
13
|
resolveCronConfig
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-ONUEYC6N.mjs";
|
|
14
|
+
} from "./chunk-YHOCRI4H.mjs";
|
|
16
15
|
import "./chunk-2UC36WAC.mjs";
|
|
16
|
+
import "./chunk-ONUEYC6N.mjs";
|
|
17
17
|
import "./chunk-KI3MESHB.mjs";
|
|
18
18
|
import "./chunk-QVKYGNVM.mjs";
|
|
19
19
|
import "./chunk-CQ6OSQ3K.mjs";
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDeployTargetForPreset
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QGVJVSNX.mjs";
|
|
4
4
|
import "./chunk-XZNTNMHT.mjs";
|
|
5
5
|
import "./chunk-FZC7EEPM.mjs";
|
|
6
6
|
import "./chunk-JBSVKMC5.mjs";
|
|
7
7
|
import "./chunk-7WPA7GBZ.mjs";
|
|
8
8
|
import "./chunk-IILNZK5G.mjs";
|
|
9
9
|
import "./chunk-OLYK7EAK.mjs";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-ZCNJKLA2.mjs";
|
|
11
11
|
import "./chunk-G2KY33I6.mjs";
|
|
12
12
|
import {
|
|
13
13
|
resolveCronConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-YHOCRI4H.mjs";
|
|
15
15
|
import "./chunk-QCFFHV5H.mjs";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-4OOBRCJX.mjs";
|
|
17
17
|
import "./chunk-FA2W42OV.mjs";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-ONUEYC6N.mjs";
|
|
18
|
+
import "./chunk-SXHV42UQ.mjs";
|
|
19
|
+
import "./chunk-EGJDUF4Q.mjs";
|
|
21
20
|
import "./chunk-2UC36WAC.mjs";
|
|
21
|
+
import "./chunk-ONUEYC6N.mjs";
|
|
22
22
|
import "./chunk-AELACLOB.mjs";
|
|
23
23
|
import "./chunk-JLCQGPXE.mjs";
|
|
24
24
|
import "./chunk-FP2INE7H.mjs";
|
package/dist/docs.cjs
CHANGED
|
@@ -3468,6 +3468,7 @@ function createFarmDocsHandler(docs, options) {
|
|
|
3468
3468
|
if (!isFarmDocsRequest(docs, request)) return null;
|
|
3469
3469
|
const page = loadPage(contentDir, docs, request);
|
|
3470
3470
|
if (!page) return null;
|
|
3471
|
+
const negotiatesAccept = !requestUrl.pathname.endsWith(".md");
|
|
3471
3472
|
if (shouldReturnMarkdown(request)) {
|
|
3472
3473
|
const origin = new URL(request.url).origin;
|
|
3473
3474
|
return omitFarmDocsHeadBody(
|
|
@@ -3482,7 +3483,8 @@ function createFarmDocsHandler(docs, options) {
|
|
|
3482
3483
|
status: 200,
|
|
3483
3484
|
headers: {
|
|
3484
3485
|
"Content-Type": "text/markdown; charset=utf-8",
|
|
3485
|
-
"Cache-Control": "public, max-age=60"
|
|
3486
|
+
"Cache-Control": "public, max-age=60",
|
|
3487
|
+
...negotiatesAccept ? { Vary: "Accept" } : {}
|
|
3486
3488
|
}
|
|
3487
3489
|
}
|
|
3488
3490
|
)
|
|
@@ -3512,6 +3514,7 @@ function createFarmDocsHandler(docs, options) {
|
|
|
3512
3514
|
headers: {
|
|
3513
3515
|
"Content-Type": "text/html; charset=utf-8",
|
|
3514
3516
|
"Cache-Control": "public, s-maxage=60, stale-while-revalidate=300",
|
|
3517
|
+
Vary: "Accept",
|
|
3515
3518
|
...fontPreloadHeader ? { Link: fontPreloadHeader } : {}
|
|
3516
3519
|
}
|
|
3517
3520
|
}
|
|
@@ -4635,11 +4638,25 @@ function normalizeMatcher(matcher) {
|
|
|
4635
4638
|
}
|
|
4636
4639
|
__name(normalizeMatcher, "normalizeMatcher");
|
|
4637
4640
|
|
|
4641
|
+
// src/utils/runtime-env.ts
|
|
4642
|
+
function getFarmRuntimeBindings() {
|
|
4643
|
+
const runtimeBindings = globalThis.__env__;
|
|
4644
|
+
return runtimeBindings && typeof runtimeBindings === "object" ? runtimeBindings : void 0;
|
|
4645
|
+
}
|
|
4646
|
+
__name(getFarmRuntimeBindings, "getFarmRuntimeBindings");
|
|
4647
|
+
function readFarmEnvironmentValue(name) {
|
|
4648
|
+
const runtimeValue = getFarmRuntimeBindings()?.[name];
|
|
4649
|
+
if (typeof runtimeValue === "string") return runtimeValue;
|
|
4650
|
+
return typeof process !== "undefined" ? process.env?.[name] : void 0;
|
|
4651
|
+
}
|
|
4652
|
+
__name(readFarmEnvironmentValue, "readFarmEnvironmentValue");
|
|
4653
|
+
|
|
4638
4654
|
// src/workflows.ts
|
|
4639
4655
|
var import_node_path6 = require("path");
|
|
4640
4656
|
|
|
4641
4657
|
// src/env.ts
|
|
4642
4658
|
var FARM_ENV_SYMBOL = /* @__PURE__ */ Symbol.for("farm.env");
|
|
4659
|
+
var FARM_ENV_RUNTIME_SYMBOL = /* @__PURE__ */ Symbol.for("farm.env.runtime");
|
|
4643
4660
|
var farmEnvGlobal = globalThis;
|
|
4644
4661
|
var currentEnv = getInitialEnv();
|
|
4645
4662
|
var env = createEnvProxy("server");
|
|
@@ -4653,7 +4670,7 @@ function createEnvProxy(scope) {
|
|
|
4653
4670
|
return void 0;
|
|
4654
4671
|
}
|
|
4655
4672
|
const env2 = getEnvScope(scope);
|
|
4656
|
-
return env2[property];
|
|
4673
|
+
return scope === "server" ? readServerEnvKey(env2, property) : env2[property];
|
|
4657
4674
|
},
|
|
4658
4675
|
ownKeys() {
|
|
4659
4676
|
return Reflect.ownKeys(getEnvScope(scope));
|
|
@@ -4677,12 +4694,74 @@ function createEnvProxy(scope) {
|
|
|
4677
4694
|
}
|
|
4678
4695
|
__name(createEnvProxy, "createEnvProxy");
|
|
4679
4696
|
function getEnvScope(scope) {
|
|
4697
|
+
const env2 = getCurrentEnv();
|
|
4680
4698
|
if (scope === "server") {
|
|
4681
4699
|
assertServerEnvAccess();
|
|
4700
|
+
readRuntimeServerEnv(env2);
|
|
4682
4701
|
}
|
|
4683
|
-
return
|
|
4702
|
+
return env2[scope] || {};
|
|
4684
4703
|
}
|
|
4685
4704
|
__name(getEnvScope, "getEnvScope");
|
|
4705
|
+
function readServerEnvKey(server, key) {
|
|
4706
|
+
const value = server[key];
|
|
4707
|
+
if (value === void 0) {
|
|
4708
|
+
const state = getCurrentEnv()[FARM_ENV_RUNTIME_SYMBOL];
|
|
4709
|
+
if (state && key in state.pending && !state.warned.has(key)) {
|
|
4710
|
+
state.warned.add(key);
|
|
4711
|
+
console.warn(
|
|
4712
|
+
`[Farm] Server env "${key}" was set when this app was built but is not set where the server runs, so it reads as undefined. Farm reads server env at runtime and does not store it in the build output; set "${key}" in the server's environment.`
|
|
4713
|
+
);
|
|
4714
|
+
}
|
|
4715
|
+
}
|
|
4716
|
+
return value;
|
|
4717
|
+
}
|
|
4718
|
+
__name(readServerEnvKey, "readServerEnvKey");
|
|
4719
|
+
function readRuntimeServerEnv(env2) {
|
|
4720
|
+
const state = env2[FARM_ENV_RUNTIME_SYMBOL];
|
|
4721
|
+
if (!state) return;
|
|
4722
|
+
for (const [key, type] of Object.entries(state.pending)) {
|
|
4723
|
+
const raw = readFarmEnvironmentValue(key);
|
|
4724
|
+
if (raw === void 0) continue;
|
|
4725
|
+
env2.server[key] = coerceRuntimeEnvValue(raw, type);
|
|
4726
|
+
delete state.pending[key];
|
|
4727
|
+
}
|
|
4728
|
+
}
|
|
4729
|
+
__name(readRuntimeServerEnv, "readRuntimeServerEnv");
|
|
4730
|
+
function coerceRuntimeEnvValue(raw, type) {
|
|
4731
|
+
if (type === "number") {
|
|
4732
|
+
const value = Number(raw);
|
|
4733
|
+
return raw.trim() !== "" && Number.isFinite(value) ? value : raw;
|
|
4734
|
+
}
|
|
4735
|
+
if (type === "boolean") {
|
|
4736
|
+
if (/^(true|1)$/i.test(raw.trim())) return true;
|
|
4737
|
+
if (/^(false|0|)$/i.test(raw.trim())) return false;
|
|
4738
|
+
return raw;
|
|
4739
|
+
}
|
|
4740
|
+
if (type === "json") {
|
|
4741
|
+
try {
|
|
4742
|
+
return JSON.parse(raw);
|
|
4743
|
+
} catch {
|
|
4744
|
+
return raw;
|
|
4745
|
+
}
|
|
4746
|
+
}
|
|
4747
|
+
return raw;
|
|
4748
|
+
}
|
|
4749
|
+
__name(coerceRuntimeEnvValue, "coerceRuntimeEnvValue");
|
|
4750
|
+
function prepareEnv(env2) {
|
|
4751
|
+
const normalized = normalizeResolvedEnv(env2);
|
|
4752
|
+
const runtime = env2.runtime?.server;
|
|
4753
|
+
if (!isRecord(runtime) || Object.keys(runtime).length === 0) return normalized;
|
|
4754
|
+
const prepared = { server: { ...normalized.server }, public: normalized.public };
|
|
4755
|
+
Object.defineProperty(prepared, FARM_ENV_RUNTIME_SYMBOL, {
|
|
4756
|
+
value: {
|
|
4757
|
+
pending: { ...runtime },
|
|
4758
|
+
warned: /* @__PURE__ */ new Set()
|
|
4759
|
+
},
|
|
4760
|
+
enumerable: false
|
|
4761
|
+
});
|
|
4762
|
+
return prepared;
|
|
4763
|
+
}
|
|
4764
|
+
__name(prepareEnv, "prepareEnv");
|
|
4686
4765
|
function assertServerEnvAccess() {
|
|
4687
4766
|
if (typeof window !== "undefined") {
|
|
4688
4767
|
throw new Error("Farm server env is not available in the browser. Use publicEnv.");
|
|
@@ -4713,7 +4792,7 @@ __name(getCurrentEnv, "getCurrentEnv");
|
|
|
4713
4792
|
function getInjectedEnv() {
|
|
4714
4793
|
try {
|
|
4715
4794
|
if (typeof __FARM_ENV__ !== "undefined" && __FARM_ENV__) {
|
|
4716
|
-
return
|
|
4795
|
+
return prepareEnv(__FARM_ENV__);
|
|
4717
4796
|
}
|
|
4718
4797
|
} catch {
|
|
4719
4798
|
}
|
package/dist/docs.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
createFarmDocsAdapterHandler,
|
|
5
5
|
hasFarmDocsRuntimeAdapter,
|
|
6
6
|
isFarmDocsAPIRequest
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UTBVHYS3.mjs";
|
|
8
8
|
import {
|
|
9
9
|
createFarmDocsHandler,
|
|
10
10
|
discoverFarmDocsPages,
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
isFarmDocsRequest,
|
|
14
14
|
loadFarmDocsPage,
|
|
15
15
|
resolveFarmDocsContentDir
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-5QOEPUYE.mjs";
|
|
17
17
|
import "./chunk-UP4CW6WP.mjs";
|
|
18
18
|
import "./chunk-TFQG7TBC.mjs";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-QGVJVSNX.mjs";
|
|
20
20
|
import "./chunk-XZNTNMHT.mjs";
|
|
21
21
|
import "./chunk-TVGP4BBZ.mjs";
|
|
22
22
|
import "./chunk-FZC7EEPM.mjs";
|
|
@@ -24,16 +24,16 @@ import "./chunk-JBSVKMC5.mjs";
|
|
|
24
24
|
import "./chunk-7WPA7GBZ.mjs";
|
|
25
25
|
import "./chunk-IILNZK5G.mjs";
|
|
26
26
|
import "./chunk-OLYK7EAK.mjs";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-ZCNJKLA2.mjs";
|
|
28
28
|
import "./chunk-G2KY33I6.mjs";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-YHOCRI4H.mjs";
|
|
30
30
|
import "./chunk-QCFFHV5H.mjs";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-4OOBRCJX.mjs";
|
|
32
32
|
import "./chunk-FA2W42OV.mjs";
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-ONUEYC6N.mjs";
|
|
33
|
+
import "./chunk-SXHV42UQ.mjs";
|
|
34
|
+
import "./chunk-EGJDUF4Q.mjs";
|
|
36
35
|
import "./chunk-2UC36WAC.mjs";
|
|
36
|
+
import "./chunk-ONUEYC6N.mjs";
|
|
37
37
|
import "./chunk-AELACLOB.mjs";
|
|
38
38
|
import "./chunk-JLCQGPXE.mjs";
|
|
39
39
|
import "./chunk-FP2INE7H.mjs";
|