@farm.js/core 0.1.0-beta.22 → 0.1.0-beta.23
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 +2 -1
- package/dist/agent-runtime.d.ts +2 -1
- package/dist/{app-BB8GCH1g.d.ts → app-CTFnOJaI.d.ts} +5 -3
- package/dist/{app-DwsTpyNZ.d.mts → app-DA6ospIq.d.mts} +5 -3
- package/dist/app-markdown.d.mts +2 -1
- package/dist/app-markdown.d.ts +2 -1
- package/dist/chunk-4IVNW5QD.mjs +82 -0
- package/dist/chunk-4IVNW5QD.mjs.map +1 -0
- package/dist/{chunk-DAUR3WUZ.mjs → chunk-5NOVWCFL.mjs} +2 -2
- package/dist/chunk-5NOVWCFL.mjs.map +1 -0
- package/dist/chunk-D42BNPZH.mjs +79 -0
- package/dist/chunk-D42BNPZH.mjs.map +1 -0
- package/dist/{chunk-LLPN5SEZ.mjs → chunk-DVPRBMU2.mjs} +2 -2
- package/dist/{chunk-ZP73P4VR.mjs → chunk-FJGTYLCO.mjs} +67 -20
- package/dist/chunk-FJGTYLCO.mjs.map +1 -0
- package/dist/chunk-GQVQESLY.mjs +25 -0
- package/dist/chunk-GQVQESLY.mjs.map +1 -0
- package/dist/chunk-H53KVQUU.mjs +48 -0
- package/dist/chunk-H53KVQUU.mjs.map +1 -0
- package/dist/chunk-HCGQYYHI.mjs +1 -0
- package/dist/chunk-HCGQYYHI.mjs.map +1 -0
- package/dist/{chunk-UCYWGN2P.mjs → chunk-OHNSROHS.mjs} +1 -1
- package/dist/{chunk-FRPWCMMG.mjs → chunk-SBWOTAX4.mjs} +63 -2
- package/dist/chunk-SBWOTAX4.mjs.map +1 -0
- package/dist/{chunk-XBKXKJX5.mjs → chunk-TX54PXAJ.mjs} +81 -25
- package/dist/chunk-TX54PXAJ.mjs.map +1 -0
- package/dist/{chunk-CEVMYGDL.mjs → chunk-YD5IRKVS.mjs} +13 -9
- package/dist/chunk-YD5IRKVS.mjs.map +1 -0
- package/dist/{client-plugins-QQntVkrv.d.mts → client-plugins-CCilIb_G.d.mts} +6 -2
- package/dist/{client-plugins-CbRum1fj.d.ts → client-plugins-DuuleQKk.d.ts} +6 -2
- package/dist/client-plugins.d.mts +2 -1
- package/dist/client-plugins.d.ts +2 -1
- package/dist/client.cjs +122 -35
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.mts +2 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.mjs +13 -2
- package/dist/config.d.mts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/{devtools-52FYXIEK.mjs → devtools-326RBQCN.mjs} +7 -6
- package/dist/{devtools-52FYXIEK.mjs.map → devtools-326RBQCN.mjs.map} +1 -1
- package/dist/docs.cjs.map +1 -1
- package/dist/docs.mjs +6 -5
- package/dist/index.cjs +431 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +10 -7
- package/dist/index.d.ts +10 -7
- package/dist/index.mjs +66 -49
- package/dist/index.mjs.map +1 -1
- package/dist/integrations.d.mts +2 -1
- package/dist/integrations.d.ts +2 -1
- package/dist/internal/build-runtime.cjs +337 -34
- package/dist/internal/build-runtime.cjs.map +1 -1
- package/dist/internal/build-runtime.d.mts +4 -3
- package/dist/internal/build-runtime.d.ts +4 -3
- package/dist/internal/build-runtime.mjs +15 -12
- package/dist/internal/config-runtime.cjs +41 -0
- package/dist/internal/config-runtime.cjs.map +1 -1
- package/dist/internal/config-runtime.d.mts +3 -2
- package/dist/internal/config-runtime.d.ts +3 -2
- package/dist/internal/config-runtime.mjs +5 -4
- package/dist/internal/production-runtime.cjs +178 -0
- package/dist/internal/production-runtime.cjs.map +1 -1
- package/dist/internal/production-runtime.d.mts +20 -6
- package/dist/internal/production-runtime.d.ts +20 -6
- package/dist/internal/production-runtime.mjs +13 -1
- package/dist/internal/production-runtime.mjs.map +1 -1
- package/dist/{metadata-B5jBJHq1.d.ts → metadata-DyPRG0wX.d.ts} +1 -1
- package/dist/{metadata-BxOJ4FJl.d.mts → metadata-_GHcAySx.d.mts} +1 -1
- package/dist/middleware.d.mts +4 -3
- package/dist/middleware.d.ts +4 -3
- package/dist/plugin.cjs +219 -14
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.mts +2 -1
- package/dist/plugin.d.ts +2 -1
- package/dist/plugin.mjs +11 -8
- package/dist/{production-runtime-Bxua86uR.d.mts → production-runtime-C4cO3esK.d.mts} +1 -1
- package/dist/{production-runtime-CZqXjRVi.d.ts → production-runtime-DrEy8kBO.d.ts} +1 -1
- package/dist/{request-7V0GaZK_.d.mts → request-B2PpOxYK.d.mts} +1 -1
- package/dist/{request-B5XYBv5a.d.ts → request-D40lt6aN.d.ts} +1 -1
- package/dist/request.d.mts +3 -2
- package/dist/request.d.ts +3 -2
- package/dist/routes.d.mts +2 -1
- package/dist/routes.d.ts +2 -1
- package/dist/server-plugins.d.mts +3 -2
- package/dist/server-plugins.d.ts +3 -2
- package/dist/server.cjs +241 -19
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.mts +8 -6
- package/dist/server.d.ts +8 -6
- package/dist/server.mjs +20 -11
- package/dist/server.mjs.map +1 -1
- package/dist/testing.d.mts +2 -1
- package/dist/testing.d.ts +2 -1
- package/dist/theme/client.cjs +115 -0
- package/dist/theme/client.cjs.map +1 -0
- package/dist/theme/client.d.mts +17 -0
- package/dist/theme/client.d.ts +17 -0
- package/dist/theme/client.mjs +16 -0
- package/dist/theme/client.mjs.map +1 -0
- package/dist/theme/index.cjs +71 -0
- package/dist/theme/index.cjs.map +1 -0
- package/dist/theme/index.d.mts +6 -0
- package/dist/theme/index.d.ts +6 -0
- package/dist/theme/index.mjs +9 -0
- package/dist/theme/index.mjs.map +1 -0
- package/dist/theme/server.cjs +191 -0
- package/dist/theme/server.cjs.map +1 -0
- package/dist/theme/server.d.mts +8 -0
- package/dist/theme/server.d.ts +8 -0
- package/dist/theme/server.mjs +18 -0
- package/dist/theme/server.mjs.map +1 -0
- package/dist/types-CsR8fpgF.d.mts +30 -0
- package/dist/types-CsR8fpgF.d.ts +30 -0
- package/dist/{utils-xTFxzu47.d.ts → utils-3sQgfkya.d.ts} +1 -1
- package/dist/{utils-s9pN0Yep.d.mts → utils-Bop7bly-.d.mts} +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +242 -15
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.mts +2 -1
- package/dist/vite.d.ts +2 -1
- package/dist/vite.mjs +11 -8
- package/package.json +25 -1
- package/dist/chunk-CEVMYGDL.mjs.map +0 -1
- package/dist/chunk-DAUR3WUZ.mjs.map +0 -1
- package/dist/chunk-FRPWCMMG.mjs.map +0 -1
- package/dist/chunk-XBKXKJX5.mjs.map +0 -1
- package/dist/chunk-ZP73P4VR.mjs.map +0 -1
- /package/dist/{chunk-LLPN5SEZ.mjs.map → chunk-DVPRBMU2.mjs.map} +0 -0
- /package/dist/{chunk-UCYWGN2P.mjs.map → chunk-OHNSROHS.mjs.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { bh as ResolvedFarmConfig } from '../client-plugins-
|
|
2
|
-
export { ai as loadConfig, ah as resolveConfig, aj as resolveDeployConfig } from '../client-plugins-
|
|
1
|
+
import { bh as ResolvedFarmConfig } from '../client-plugins-CCilIb_G.mjs';
|
|
2
|
+
export { ai as loadConfig, ah as resolveConfig, aj as resolveDeployConfig } from '../client-plugins-CCilIb_G.mjs';
|
|
3
3
|
import { FarmProductionViteRuntime } from './config-runtime.mjs';
|
|
4
|
-
export { l as logger } from '../utils-
|
|
4
|
+
export { l as logger } from '../utils-Bop7bly-.mjs';
|
|
5
5
|
import '../plugin-BJDf43dc.mjs';
|
|
6
6
|
import 'react';
|
|
7
7
|
import 'http';
|
|
@@ -23,6 +23,7 @@ import '../server-fn-error-DDh14a0V.mjs';
|
|
|
23
23
|
import '../image-config-Duob7wER.mjs';
|
|
24
24
|
import '../types-BMxWr97v.mjs';
|
|
25
25
|
import '../cache.mjs';
|
|
26
|
+
import '../types-CsR8fpgF.mjs';
|
|
26
27
|
import '../route-runtime-DoOHzCAD.mjs';
|
|
27
28
|
import '../font.mjs';
|
|
28
29
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { bh as ResolvedFarmConfig } from '../client-plugins-
|
|
2
|
-
export { ai as loadConfig, ah as resolveConfig, aj as resolveDeployConfig } from '../client-plugins-
|
|
1
|
+
import { bh as ResolvedFarmConfig } from '../client-plugins-DuuleQKk.js';
|
|
2
|
+
export { ai as loadConfig, ah as resolveConfig, aj as resolveDeployConfig } from '../client-plugins-DuuleQKk.js';
|
|
3
3
|
import { FarmProductionViteRuntime } from './config-runtime.js';
|
|
4
|
-
export { l as logger } from '../utils-
|
|
4
|
+
export { l as logger } from '../utils-3sQgfkya.js';
|
|
5
5
|
import '../plugin-BJDf43dc.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import 'http';
|
|
@@ -23,6 +23,7 @@ import '../server-fn-error-DDh14a0V.js';
|
|
|
23
23
|
import '../image-config-Duob7wER.js';
|
|
24
24
|
import '../types-BMxWr97v.js';
|
|
25
25
|
import '../cache.js';
|
|
26
|
+
import '../types-CsR8fpgF.js';
|
|
26
27
|
import '../route-runtime-DoOHzCAD.js';
|
|
27
28
|
import '../font.js';
|
|
28
29
|
|
|
@@ -1,41 +1,43 @@
|
|
|
1
1
|
import {
|
|
2
2
|
build
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-4S3ORGFA.mjs";
|
|
3
|
+
} from "../chunk-FJGTYLCO.mjs";
|
|
5
4
|
import "../chunk-SL6HTIOK.mjs";
|
|
6
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-4S3ORGFA.mjs";
|
|
6
|
+
import "../chunk-DVPRBMU2.mjs";
|
|
7
7
|
import "../chunk-V7RBCSDJ.mjs";
|
|
8
8
|
import {
|
|
9
9
|
loadConfig,
|
|
10
10
|
resolveConfig,
|
|
11
11
|
resolveDeployConfig
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-YD5IRKVS.mjs";
|
|
13
13
|
import "../chunk-UVCIEUJC.mjs";
|
|
14
14
|
import "../chunk-A53LP5QG.mjs";
|
|
15
15
|
import "../chunk-RQ633A5I.mjs";
|
|
16
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-TX54PXAJ.mjs";
|
|
17
17
|
import "../chunk-LGHEOHBU.mjs";
|
|
18
|
-
import "../chunk-FRPWCMMG.mjs";
|
|
19
18
|
import "../chunk-53MVSX3R.mjs";
|
|
20
|
-
import "../chunk-6ZXIQSXE.mjs";
|
|
21
|
-
import "../chunk-V6WE6JSZ.mjs";
|
|
22
19
|
import "../chunk-3XNTL3FQ.mjs";
|
|
20
|
+
import "../chunk-SBWOTAX4.mjs";
|
|
23
21
|
import "../chunk-CGIXMLSY.mjs";
|
|
24
22
|
import "../chunk-USWZZUEH.mjs";
|
|
23
|
+
import "../chunk-6ZXIQSXE.mjs";
|
|
24
|
+
import "../chunk-V6WE6JSZ.mjs";
|
|
25
25
|
import "../chunk-XMFTIVJH.mjs";
|
|
26
26
|
import "../chunk-7HO6AEOP.mjs";
|
|
27
|
+
import "../chunk-4IVNW5QD.mjs";
|
|
27
28
|
import "../chunk-USLFXFFH.mjs";
|
|
28
29
|
import "../chunk-E257KFBU.mjs";
|
|
29
30
|
import "../chunk-7MABZJIM.mjs";
|
|
30
31
|
import "../chunk-YW7OBE6Q.mjs";
|
|
31
32
|
import "../chunk-74YTBPTY.mjs";
|
|
32
|
-
import "../chunk-7ZVN3YZI.mjs";
|
|
33
33
|
import "../chunk-GY2STC2S.mjs";
|
|
34
|
+
import "../chunk-7ZVN3YZI.mjs";
|
|
35
|
+
import "../chunk-4E6VRJ6P.mjs";
|
|
36
|
+
import "../chunk-GXASWWJU.mjs";
|
|
34
37
|
import "../chunk-WORFTBLU.mjs";
|
|
38
|
+
import "../chunk-H53KVQUU.mjs";
|
|
35
39
|
import "../chunk-ZVWA4ZQ3.mjs";
|
|
36
40
|
import "../chunk-7FBJLMQH.mjs";
|
|
37
|
-
import "../chunk-4E6VRJ6P.mjs";
|
|
38
|
-
import "../chunk-GXASWWJU.mjs";
|
|
39
41
|
import "../chunk-CRN3AH35.mjs";
|
|
40
42
|
import "../chunk-T4QJQK76.mjs";
|
|
41
43
|
import "../chunk-2PEJGY5V.mjs";
|
|
@@ -57,9 +59,10 @@ import "../chunk-KQCOGTU7.mjs";
|
|
|
57
59
|
import "../chunk-YTMDIHQN.mjs";
|
|
58
60
|
import "../chunk-RHIFZZUI.mjs";
|
|
59
61
|
import "../chunk-LM2YNO4U.mjs";
|
|
60
|
-
import "../chunk-
|
|
62
|
+
import "../chunk-5NOVWCFL.mjs";
|
|
61
63
|
import "../chunk-B3FFOIWS.mjs";
|
|
62
64
|
import "../chunk-ITN462YM.mjs";
|
|
65
|
+
import "../chunk-GQVQESLY.mjs";
|
|
63
66
|
import "../chunk-3HIVDX7J.mjs";
|
|
64
67
|
import "../chunk-JK25YEN6.mjs";
|
|
65
68
|
import "../chunk-GS6K5OCM.mjs";
|
|
@@ -4271,6 +4271,46 @@ function isPlainRecord(value) {
|
|
|
4271
4271
|
}
|
|
4272
4272
|
__name(isPlainRecord, "isPlainRecord");
|
|
4273
4273
|
|
|
4274
|
+
// src/theme/config.ts
|
|
4275
|
+
var DEFAULT_FARM_THEME_STORAGE_KEY = "farm-theme";
|
|
4276
|
+
var STORAGE_KEY_PATTERN = /^[A-Za-z0-9._-]+$/;
|
|
4277
|
+
function resolveFarmThemeConfig(config, basePath = "/") {
|
|
4278
|
+
if (config && "enabled" in config) {
|
|
4279
|
+
return config;
|
|
4280
|
+
}
|
|
4281
|
+
if (!config) {
|
|
4282
|
+
return {
|
|
4283
|
+
enabled: false,
|
|
4284
|
+
default: "system",
|
|
4285
|
+
storageKey: DEFAULT_FARM_THEME_STORAGE_KEY,
|
|
4286
|
+
cookiePath: normalizeCookiePath(basePath)
|
|
4287
|
+
};
|
|
4288
|
+
}
|
|
4289
|
+
const storageKey = config.storageKey?.trim() || DEFAULT_FARM_THEME_STORAGE_KEY;
|
|
4290
|
+
if (!STORAGE_KEY_PATTERN.test(storageKey)) {
|
|
4291
|
+
throw new Error(
|
|
4292
|
+
"theme.storageKey may only contain letters, numbers, dots, underscores, and hyphens."
|
|
4293
|
+
);
|
|
4294
|
+
}
|
|
4295
|
+
const defaultTheme = config.default ?? "system";
|
|
4296
|
+
if (defaultTheme !== "light" && defaultTheme !== "dark" && defaultTheme !== "system") {
|
|
4297
|
+
throw new Error('theme.default must be "light", "dark", or "system".');
|
|
4298
|
+
}
|
|
4299
|
+
return {
|
|
4300
|
+
enabled: true,
|
|
4301
|
+
default: defaultTheme,
|
|
4302
|
+
storageKey,
|
|
4303
|
+
cookiePath: normalizeCookiePath(basePath)
|
|
4304
|
+
};
|
|
4305
|
+
}
|
|
4306
|
+
__name(resolveFarmThemeConfig, "resolveFarmThemeConfig");
|
|
4307
|
+
function normalizeCookiePath(basePath) {
|
|
4308
|
+
const normalized = `/${basePath}`.replace(/\/{2,}/g, "/");
|
|
4309
|
+
if (normalized === "/") return normalized;
|
|
4310
|
+
return normalized.replace(/\/$/, "");
|
|
4311
|
+
}
|
|
4312
|
+
__name(normalizeCookiePath, "normalizeCookiePath");
|
|
4313
|
+
|
|
4274
4314
|
// src/config.ts
|
|
4275
4315
|
var FARM_RESOLVED_CUSTOM_CONTEXT = /* @__PURE__ */ Symbol.for("farm.resolvedCustomContext");
|
|
4276
4316
|
function normalizeDeployTarget(target) {
|
|
@@ -4611,6 +4651,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
4611
4651
|
routeRules,
|
|
4612
4652
|
images: resolveFarmImageConfig(userConfig.images),
|
|
4613
4653
|
performance: resolveFarmPerformanceConfig(userConfig.performance),
|
|
4654
|
+
theme: resolveFarmThemeConfig(userConfig.theme, userConfig.basePath || "/"),
|
|
4614
4655
|
publicDir: userConfig.publicDir || "public",
|
|
4615
4656
|
i18n: resolveFarmI18nConfig(userConfig.i18n, { root, mode }),
|
|
4616
4657
|
openapi: {
|