@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.
Files changed (132) hide show
  1. package/dist/agent-runtime.d.mts +2 -1
  2. package/dist/agent-runtime.d.ts +2 -1
  3. package/dist/{app-BB8GCH1g.d.ts → app-CTFnOJaI.d.ts} +5 -3
  4. package/dist/{app-DwsTpyNZ.d.mts → app-DA6ospIq.d.mts} +5 -3
  5. package/dist/app-markdown.d.mts +2 -1
  6. package/dist/app-markdown.d.ts +2 -1
  7. package/dist/chunk-4IVNW5QD.mjs +82 -0
  8. package/dist/chunk-4IVNW5QD.mjs.map +1 -0
  9. package/dist/{chunk-DAUR3WUZ.mjs → chunk-5NOVWCFL.mjs} +2 -2
  10. package/dist/chunk-5NOVWCFL.mjs.map +1 -0
  11. package/dist/chunk-D42BNPZH.mjs +79 -0
  12. package/dist/chunk-D42BNPZH.mjs.map +1 -0
  13. package/dist/{chunk-LLPN5SEZ.mjs → chunk-DVPRBMU2.mjs} +2 -2
  14. package/dist/{chunk-ZP73P4VR.mjs → chunk-FJGTYLCO.mjs} +67 -20
  15. package/dist/chunk-FJGTYLCO.mjs.map +1 -0
  16. package/dist/chunk-GQVQESLY.mjs +25 -0
  17. package/dist/chunk-GQVQESLY.mjs.map +1 -0
  18. package/dist/chunk-H53KVQUU.mjs +48 -0
  19. package/dist/chunk-H53KVQUU.mjs.map +1 -0
  20. package/dist/chunk-HCGQYYHI.mjs +1 -0
  21. package/dist/chunk-HCGQYYHI.mjs.map +1 -0
  22. package/dist/{chunk-UCYWGN2P.mjs → chunk-OHNSROHS.mjs} +1 -1
  23. package/dist/{chunk-FRPWCMMG.mjs → chunk-SBWOTAX4.mjs} +63 -2
  24. package/dist/chunk-SBWOTAX4.mjs.map +1 -0
  25. package/dist/{chunk-XBKXKJX5.mjs → chunk-TX54PXAJ.mjs} +81 -25
  26. package/dist/chunk-TX54PXAJ.mjs.map +1 -0
  27. package/dist/{chunk-CEVMYGDL.mjs → chunk-YD5IRKVS.mjs} +13 -9
  28. package/dist/chunk-YD5IRKVS.mjs.map +1 -0
  29. package/dist/{client-plugins-QQntVkrv.d.mts → client-plugins-CCilIb_G.d.mts} +6 -2
  30. package/dist/{client-plugins-CbRum1fj.d.ts → client-plugins-DuuleQKk.d.ts} +6 -2
  31. package/dist/client-plugins.d.mts +2 -1
  32. package/dist/client-plugins.d.ts +2 -1
  33. package/dist/client.cjs +122 -35
  34. package/dist/client.cjs.map +1 -1
  35. package/dist/client.d.mts +2 -0
  36. package/dist/client.d.ts +2 -0
  37. package/dist/client.mjs +13 -2
  38. package/dist/config.d.mts +2 -1
  39. package/dist/config.d.ts +2 -1
  40. package/dist/{devtools-52FYXIEK.mjs → devtools-326RBQCN.mjs} +7 -6
  41. package/dist/{devtools-52FYXIEK.mjs.map → devtools-326RBQCN.mjs.map} +1 -1
  42. package/dist/docs.cjs.map +1 -1
  43. package/dist/docs.mjs +6 -5
  44. package/dist/index.cjs +431 -55
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/index.d.mts +10 -7
  47. package/dist/index.d.ts +10 -7
  48. package/dist/index.mjs +66 -49
  49. package/dist/index.mjs.map +1 -1
  50. package/dist/integrations.d.mts +2 -1
  51. package/dist/integrations.d.ts +2 -1
  52. package/dist/internal/build-runtime.cjs +337 -34
  53. package/dist/internal/build-runtime.cjs.map +1 -1
  54. package/dist/internal/build-runtime.d.mts +4 -3
  55. package/dist/internal/build-runtime.d.ts +4 -3
  56. package/dist/internal/build-runtime.mjs +15 -12
  57. package/dist/internal/config-runtime.cjs +41 -0
  58. package/dist/internal/config-runtime.cjs.map +1 -1
  59. package/dist/internal/config-runtime.d.mts +3 -2
  60. package/dist/internal/config-runtime.d.ts +3 -2
  61. package/dist/internal/config-runtime.mjs +5 -4
  62. package/dist/internal/production-runtime.cjs +178 -0
  63. package/dist/internal/production-runtime.cjs.map +1 -1
  64. package/dist/internal/production-runtime.d.mts +20 -6
  65. package/dist/internal/production-runtime.d.ts +20 -6
  66. package/dist/internal/production-runtime.mjs +13 -1
  67. package/dist/internal/production-runtime.mjs.map +1 -1
  68. package/dist/{metadata-B5jBJHq1.d.ts → metadata-DyPRG0wX.d.ts} +1 -1
  69. package/dist/{metadata-BxOJ4FJl.d.mts → metadata-_GHcAySx.d.mts} +1 -1
  70. package/dist/middleware.d.mts +4 -3
  71. package/dist/middleware.d.ts +4 -3
  72. package/dist/plugin.cjs +219 -14
  73. package/dist/plugin.cjs.map +1 -1
  74. package/dist/plugin.d.mts +2 -1
  75. package/dist/plugin.d.ts +2 -1
  76. package/dist/plugin.mjs +11 -8
  77. package/dist/{production-runtime-Bxua86uR.d.mts → production-runtime-C4cO3esK.d.mts} +1 -1
  78. package/dist/{production-runtime-CZqXjRVi.d.ts → production-runtime-DrEy8kBO.d.ts} +1 -1
  79. package/dist/{request-7V0GaZK_.d.mts → request-B2PpOxYK.d.mts} +1 -1
  80. package/dist/{request-B5XYBv5a.d.ts → request-D40lt6aN.d.ts} +1 -1
  81. package/dist/request.d.mts +3 -2
  82. package/dist/request.d.ts +3 -2
  83. package/dist/routes.d.mts +2 -1
  84. package/dist/routes.d.ts +2 -1
  85. package/dist/server-plugins.d.mts +3 -2
  86. package/dist/server-plugins.d.ts +3 -2
  87. package/dist/server.cjs +241 -19
  88. package/dist/server.cjs.map +1 -1
  89. package/dist/server.d.mts +8 -6
  90. package/dist/server.d.ts +8 -6
  91. package/dist/server.mjs +20 -11
  92. package/dist/server.mjs.map +1 -1
  93. package/dist/testing.d.mts +2 -1
  94. package/dist/testing.d.ts +2 -1
  95. package/dist/theme/client.cjs +115 -0
  96. package/dist/theme/client.cjs.map +1 -0
  97. package/dist/theme/client.d.mts +17 -0
  98. package/dist/theme/client.d.ts +17 -0
  99. package/dist/theme/client.mjs +16 -0
  100. package/dist/theme/client.mjs.map +1 -0
  101. package/dist/theme/index.cjs +71 -0
  102. package/dist/theme/index.cjs.map +1 -0
  103. package/dist/theme/index.d.mts +6 -0
  104. package/dist/theme/index.d.ts +6 -0
  105. package/dist/theme/index.mjs +9 -0
  106. package/dist/theme/index.mjs.map +1 -0
  107. package/dist/theme/server.cjs +191 -0
  108. package/dist/theme/server.cjs.map +1 -0
  109. package/dist/theme/server.d.mts +8 -0
  110. package/dist/theme/server.d.ts +8 -0
  111. package/dist/theme/server.mjs +18 -0
  112. package/dist/theme/server.mjs.map +1 -0
  113. package/dist/types-CsR8fpgF.d.mts +30 -0
  114. package/dist/types-CsR8fpgF.d.ts +30 -0
  115. package/dist/{utils-xTFxzu47.d.ts → utils-3sQgfkya.d.ts} +1 -1
  116. package/dist/{utils-s9pN0Yep.d.mts → utils-Bop7bly-.d.mts} +1 -1
  117. package/dist/version.cjs +1 -1
  118. package/dist/version.cjs.map +1 -1
  119. package/dist/version.mjs +1 -1
  120. package/dist/vite.cjs +242 -15
  121. package/dist/vite.cjs.map +1 -1
  122. package/dist/vite.d.mts +2 -1
  123. package/dist/vite.d.ts +2 -1
  124. package/dist/vite.mjs +11 -8
  125. package/package.json +25 -1
  126. package/dist/chunk-CEVMYGDL.mjs.map +0 -1
  127. package/dist/chunk-DAUR3WUZ.mjs.map +0 -1
  128. package/dist/chunk-FRPWCMMG.mjs.map +0 -1
  129. package/dist/chunk-XBKXKJX5.mjs.map +0 -1
  130. package/dist/chunk-ZP73P4VR.mjs.map +0 -1
  131. /package/dist/{chunk-LLPN5SEZ.mjs.map → chunk-DVPRBMU2.mjs.map} +0 -0
  132. /package/dist/{chunk-UCYWGN2P.mjs.map → chunk-OHNSROHS.mjs.map} +0 -0
package/dist/server.d.mts CHANGED
@@ -1,13 +1,14 @@
1
- export { F as FarmApp, R as RouteManager, S as ServerRenderer, c as createFarmApp } from './app-DwsTpyNZ.mjs';
2
- import { F as FarmConfig } from './client-plugins-QQntVkrv.mjs';
3
- export { A as AppRoutePattern, D as BuildOptions, r as ErrorBoundary, E as ErrorProps, h as FarmAppContext, g as FarmContextFactory, e as FarmContextFactoryInput, J as FarmLayerEntry, T as FarmLayerResolution, a as FarmMigrationCommand, b as FarmMigrationsConfig, c as FarmMigrationsUserConfig, x as FarmRequest, y as FarmResponse, O as FarmSourceRoot, G as GenerateStaticParams, p as Layout, n as LayoutMetadataProps, v as LayoutModule, l as LayoutProps, q as Loading, L as LoadingProps, w as Metadata, m as MetadataProps, M as MiddlewareProps, N as NitroPreset, o as Page, j as PageProps, k as PagePropsWithMiddleware, P as PageRouteParams, C as ParsedRoute, i as PluginContextProps, Q as ResolveFarmLayersOptions, K as ResolvedFarmLayer, R as ResolvedFarmMigrationsConfig, s as RouteModule, B as RouteSegment, I as SSGCollectionResult, H as SSGPage, z as ServerAction, t as StaticPathParams, S as StaticPathPrimitive, u as StaticRouteParams, d as defineConfig, f as farmPlugin, W as getFarmAppDirectories, X as getFarmLayerAliases, V as getFarmSourceRoots, Y as loadFarmConfigFile, U as resolveFarmLayers } from './client-plugins-QQntVkrv.mjs';
4
- export { f as fileExists, g as globFiles, l as logger, m as matchRoute, p as parseRoutePath, a as parseSearchParams, r as resolveAppPath, s as segmentsToPattern, t as toViteModuleId } from './utils-s9pN0Yep.mjs';
1
+ export { F as FarmApp, R as RouteManager, S as ServerRenderer, c as createFarmApp } from './app-DA6ospIq.mjs';
2
+ import { F as FarmConfig } from './client-plugins-CCilIb_G.mjs';
3
+ export { A as AppRoutePattern, D as BuildOptions, r as ErrorBoundary, E as ErrorProps, h as FarmAppContext, g as FarmContextFactory, e as FarmContextFactoryInput, J as FarmLayerEntry, T as FarmLayerResolution, a as FarmMigrationCommand, b as FarmMigrationsConfig, c as FarmMigrationsUserConfig, x as FarmRequest, y as FarmResponse, O as FarmSourceRoot, G as GenerateStaticParams, p as Layout, n as LayoutMetadataProps, v as LayoutModule, l as LayoutProps, q as Loading, L as LoadingProps, w as Metadata, m as MetadataProps, M as MiddlewareProps, N as NitroPreset, o as Page, j as PageProps, k as PagePropsWithMiddleware, P as PageRouteParams, C as ParsedRoute, i as PluginContextProps, Q as ResolveFarmLayersOptions, K as ResolvedFarmLayer, R as ResolvedFarmMigrationsConfig, s as RouteModule, B as RouteSegment, I as SSGCollectionResult, H as SSGPage, z as ServerAction, t as StaticPathParams, S as StaticPathPrimitive, u as StaticRouteParams, d as defineConfig, f as farmPlugin, W as getFarmAppDirectories, X as getFarmLayerAliases, V as getFarmSourceRoots, Y as loadFarmConfigFile, U as resolveFarmLayers } from './client-plugins-CCilIb_G.mjs';
4
+ export { f as fileExists, g as globFiles, l as logger, m as matchRoute, p as parseRoutePath, a as parseSearchParams, r as resolveAppPath, s as segmentsToPattern, t as toViteModuleId } from './utils-Bop7bly-.mjs';
5
5
  export { createFarmStorage, createStorageClient, databaseStorage, defineStorageClient, disposeStorage, driverStorage, getStorage, initStorage, libsqlStorage, localStorage, memoryStorage, mongodbStorage, mysql2Storage, mysqlStorage, netlifyBlobsStorage, pgStorage, pgliteStorage, planetscaleStorage, postgresStorage, redisStorage, resolveStorageRuntimeClient, s3Storage, sqliteStorage, upstashStorage, vercelBlobStorage, vercelKVStorage } from './storage.mjs';
6
6
  export { CacheKeyFactory, DefinedCacheKey, FarmCacheAdapter, FarmCacheEntry, FarmCacheInvalidationTarget, FarmCacheOptions, FarmCacheSetOptions, FarmCacheStorage, FarmCacheUserConfig, FarmDataCache, GetFarmCacheEntryOptions, InferCacheKeyData, RevalidateTagProfile, RouteDataCacheKey, StorageFarmCacheAdapterOptions, applyFarmCacheInvalidationTargets, applyFarmCacheInvalidations, configureFarmCache, createFarmCacheKey, createPathCacheTag, createRouteDataCacheKey, createRouteDataCacheTag, defineCacheKey, getFarmDataCache, invalidate, invalidateRouteData, normalizeRevalidatePath, revalidatePath, revalidateTag, storageCacheAdapter, unstable_cache, updateTag } from './cache.mjs';
7
7
  export { AfterCallback, FarmAfterPlatformContext, _runWithAfterNodeResponse, _runWithAfterRequest, _withAfterNodeMiddleware, after } from './after.mjs';
8
8
  export { FARM_SERVER_QUERY_SYMBOL, ServerQuery, ServerQueryKey, ServerQueryOptions, ServerQueryOutputOptions, ServerQueryStaleTime, createServerQuery } from './server-query.mjs';
9
9
  import { ViteDevServer } from 'vite';
10
- export { g as getCurrentRequest } from './request-7V0GaZK_.mjs';
10
+ export { g as getCurrentRequest } from './request-B2PpOxYK.mjs';
11
+ export { getTheme, getThemeSnapshot } from './theme/server.mjs';
11
12
  export { DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT, FarmServerActionsConfig, PreparedServerActionRequest, ResolvedFarmServerActionsConfig, SanitizedServerActionError, ServerActionRequestError, ServerActionRequestKind, createServerActionRequestErrorResponse, getServerActionExecutionContext, getServerActionInvalidations, getServerActionSignal, prepareServerActionRequest, resolveServerActionsConfig, runWithServerActionRequest, sanitizeServerActionError, validateServerActionRequest } from './server-action-security.mjs';
12
13
  export { FarmEnvironment, FarmEnvironmentError, FarmIsomorphicFnOptions, createClientOnlyFn, createIsomorphicFn, createServerOnlyFn } from './environment.mjs';
13
14
  export { F as FarmStorageBuiltinDriverConfig, a as FarmStorageClient, b as FarmStorageClientConfig, c as FarmStorageConfigObject, d as FarmStorageCustomDriverConfig, e as FarmStorageDatabaseConfig, f as FarmStorageDatabaseDriverName, g as FarmStorageLocalDriverConfig, i as FarmStorageMountConfig, j as FarmStorageMounts, h as FarmStorageRuntimeClient, k as FarmStorageUserConfig } from './types-D1A6-XvH.mjs';
@@ -22,11 +23,12 @@ import './image-config-Duob7wER.mjs';
22
23
  import './routes.mjs';
23
24
  import './route-runtime-DoOHzCAD.mjs';
24
25
  import 'react';
25
- import './metadata-BxOJ4FJl.mjs';
26
+ import './metadata-_GHcAySx.mjs';
26
27
  import './island-CfGru1MO.mjs';
27
28
  import './types-BMxWr97v.mjs';
28
29
  import './runtime-Cxpq6xZN.mjs';
29
30
  import './resolver-DJqjLMg_.mjs';
31
+ import './types-CsR8fpgF.mjs';
30
32
  import './plugin-BJDf43dc.mjs';
31
33
  import 'http';
32
34
  import './integration-api-CHT2OKAf.mjs';
package/dist/server.d.ts CHANGED
@@ -1,13 +1,14 @@
1
- export { F as FarmApp, R as RouteManager, S as ServerRenderer, c as createFarmApp } from './app-BB8GCH1g.js';
2
- import { F as FarmConfig } from './client-plugins-CbRum1fj.js';
3
- export { A as AppRoutePattern, D as BuildOptions, r as ErrorBoundary, E as ErrorProps, h as FarmAppContext, g as FarmContextFactory, e as FarmContextFactoryInput, J as FarmLayerEntry, T as FarmLayerResolution, a as FarmMigrationCommand, b as FarmMigrationsConfig, c as FarmMigrationsUserConfig, x as FarmRequest, y as FarmResponse, O as FarmSourceRoot, G as GenerateStaticParams, p as Layout, n as LayoutMetadataProps, v as LayoutModule, l as LayoutProps, q as Loading, L as LoadingProps, w as Metadata, m as MetadataProps, M as MiddlewareProps, N as NitroPreset, o as Page, j as PageProps, k as PagePropsWithMiddleware, P as PageRouteParams, C as ParsedRoute, i as PluginContextProps, Q as ResolveFarmLayersOptions, K as ResolvedFarmLayer, R as ResolvedFarmMigrationsConfig, s as RouteModule, B as RouteSegment, I as SSGCollectionResult, H as SSGPage, z as ServerAction, t as StaticPathParams, S as StaticPathPrimitive, u as StaticRouteParams, d as defineConfig, f as farmPlugin, W as getFarmAppDirectories, X as getFarmLayerAliases, V as getFarmSourceRoots, Y as loadFarmConfigFile, U as resolveFarmLayers } from './client-plugins-CbRum1fj.js';
4
- export { f as fileExists, g as globFiles, l as logger, m as matchRoute, p as parseRoutePath, a as parseSearchParams, r as resolveAppPath, s as segmentsToPattern, t as toViteModuleId } from './utils-xTFxzu47.js';
1
+ export { F as FarmApp, R as RouteManager, S as ServerRenderer, c as createFarmApp } from './app-CTFnOJaI.js';
2
+ import { F as FarmConfig } from './client-plugins-DuuleQKk.js';
3
+ export { A as AppRoutePattern, D as BuildOptions, r as ErrorBoundary, E as ErrorProps, h as FarmAppContext, g as FarmContextFactory, e as FarmContextFactoryInput, J as FarmLayerEntry, T as FarmLayerResolution, a as FarmMigrationCommand, b as FarmMigrationsConfig, c as FarmMigrationsUserConfig, x as FarmRequest, y as FarmResponse, O as FarmSourceRoot, G as GenerateStaticParams, p as Layout, n as LayoutMetadataProps, v as LayoutModule, l as LayoutProps, q as Loading, L as LoadingProps, w as Metadata, m as MetadataProps, M as MiddlewareProps, N as NitroPreset, o as Page, j as PageProps, k as PagePropsWithMiddleware, P as PageRouteParams, C as ParsedRoute, i as PluginContextProps, Q as ResolveFarmLayersOptions, K as ResolvedFarmLayer, R as ResolvedFarmMigrationsConfig, s as RouteModule, B as RouteSegment, I as SSGCollectionResult, H as SSGPage, z as ServerAction, t as StaticPathParams, S as StaticPathPrimitive, u as StaticRouteParams, d as defineConfig, f as farmPlugin, W as getFarmAppDirectories, X as getFarmLayerAliases, V as getFarmSourceRoots, Y as loadFarmConfigFile, U as resolveFarmLayers } from './client-plugins-DuuleQKk.js';
4
+ export { f as fileExists, g as globFiles, l as logger, m as matchRoute, p as parseRoutePath, a as parseSearchParams, r as resolveAppPath, s as segmentsToPattern, t as toViteModuleId } from './utils-3sQgfkya.js';
5
5
  export { createFarmStorage, createStorageClient, databaseStorage, defineStorageClient, disposeStorage, driverStorage, getStorage, initStorage, libsqlStorage, localStorage, memoryStorage, mongodbStorage, mysql2Storage, mysqlStorage, netlifyBlobsStorage, pgStorage, pgliteStorage, planetscaleStorage, postgresStorage, redisStorage, resolveStorageRuntimeClient, s3Storage, sqliteStorage, upstashStorage, vercelBlobStorage, vercelKVStorage } from './storage.js';
6
6
  export { CacheKeyFactory, DefinedCacheKey, FarmCacheAdapter, FarmCacheEntry, FarmCacheInvalidationTarget, FarmCacheOptions, FarmCacheSetOptions, FarmCacheStorage, FarmCacheUserConfig, FarmDataCache, GetFarmCacheEntryOptions, InferCacheKeyData, RevalidateTagProfile, RouteDataCacheKey, StorageFarmCacheAdapterOptions, applyFarmCacheInvalidationTargets, applyFarmCacheInvalidations, configureFarmCache, createFarmCacheKey, createPathCacheTag, createRouteDataCacheKey, createRouteDataCacheTag, defineCacheKey, getFarmDataCache, invalidate, invalidateRouteData, normalizeRevalidatePath, revalidatePath, revalidateTag, storageCacheAdapter, unstable_cache, updateTag } from './cache.js';
7
7
  export { AfterCallback, FarmAfterPlatformContext, _runWithAfterNodeResponse, _runWithAfterRequest, _withAfterNodeMiddleware, after } from './after.js';
8
8
  export { FARM_SERVER_QUERY_SYMBOL, ServerQuery, ServerQueryKey, ServerQueryOptions, ServerQueryOutputOptions, ServerQueryStaleTime, createServerQuery } from './server-query.js';
9
9
  import { ViteDevServer } from 'vite';
10
- export { g as getCurrentRequest } from './request-B5XYBv5a.js';
10
+ export { g as getCurrentRequest } from './request-D40lt6aN.js';
11
+ export { getTheme, getThemeSnapshot } from './theme/server.js';
11
12
  export { DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT, FarmServerActionsConfig, PreparedServerActionRequest, ResolvedFarmServerActionsConfig, SanitizedServerActionError, ServerActionRequestError, ServerActionRequestKind, createServerActionRequestErrorResponse, getServerActionExecutionContext, getServerActionInvalidations, getServerActionSignal, prepareServerActionRequest, resolveServerActionsConfig, runWithServerActionRequest, sanitizeServerActionError, validateServerActionRequest } from './server-action-security.js';
12
13
  export { FarmEnvironment, FarmEnvironmentError, FarmIsomorphicFnOptions, createClientOnlyFn, createIsomorphicFn, createServerOnlyFn } from './environment.js';
13
14
  export { F as FarmStorageBuiltinDriverConfig, a as FarmStorageClient, b as FarmStorageClientConfig, c as FarmStorageConfigObject, d as FarmStorageCustomDriverConfig, e as FarmStorageDatabaseConfig, f as FarmStorageDatabaseDriverName, g as FarmStorageLocalDriverConfig, i as FarmStorageMountConfig, j as FarmStorageMounts, h as FarmStorageRuntimeClient, k as FarmStorageUserConfig } from './types-D1A6-XvH.js';
@@ -22,11 +23,12 @@ import './image-config-Duob7wER.js';
22
23
  import './routes.js';
23
24
  import './route-runtime-DoOHzCAD.js';
24
25
  import 'react';
25
- import './metadata-B5jBJHq1.js';
26
+ import './metadata-DyPRG0wX.js';
26
27
  import './island-CfGru1MO.js';
27
28
  import './types-BMxWr97v.js';
28
29
  import './runtime-bv63eUiO.js';
29
30
  import './resolver-IH4RmPEl.js';
31
+ import './types-CsR8fpgF.js';
30
32
  import './plugin-BJDf43dc.js';
31
33
  import 'http';
32
34
  import './integration-api-CHT2OKAf.js';
package/dist/server.mjs CHANGED
@@ -12,7 +12,7 @@ import "./chunk-CSLA7ALU.mjs";
12
12
  import {
13
13
  loadConfig,
14
14
  resolveConfig
15
- } from "./chunk-CEVMYGDL.mjs";
15
+ } from "./chunk-YD5IRKVS.mjs";
16
16
  import "./chunk-UVCIEUJC.mjs";
17
17
  import {
18
18
  PluginManager
@@ -26,23 +26,28 @@ import {
26
26
  createFarmApp,
27
27
  createFarmClientOptimizeDepsConfig,
28
28
  createFarmClientOptimizeDepsEntries,
29
+ createFarmThemeCssPlugin,
29
30
  defineConfig,
30
31
  farmI18nClientBridgePlugin,
31
32
  farmPlugin,
32
33
  mergeFarmViteConfig
33
- } from "./chunk-XBKXKJX5.mjs";
34
+ } from "./chunk-TX54PXAJ.mjs";
34
35
  import "./chunk-LGHEOHBU.mjs";
35
- import "./chunk-FRPWCMMG.mjs";
36
36
  import "./chunk-53MVSX3R.mjs";
37
+ import "./chunk-3XNTL3FQ.mjs";
38
+ import "./chunk-SBWOTAX4.mjs";
39
+ import "./chunk-CGIXMLSY.mjs";
40
+ import "./chunk-USWZZUEH.mjs";
37
41
  import "./chunk-6ZXIQSXE.mjs";
38
42
  import {
39
43
  farmEnvironmentFunctionsPlugin
40
44
  } from "./chunk-V6WE6JSZ.mjs";
41
- import "./chunk-3XNTL3FQ.mjs";
42
- import "./chunk-CGIXMLSY.mjs";
43
- import "./chunk-USWZZUEH.mjs";
44
45
  import "./chunk-XMFTIVJH.mjs";
45
46
  import "./chunk-7HO6AEOP.mjs";
47
+ import {
48
+ getTheme,
49
+ getThemeSnapshot
50
+ } from "./chunk-4IVNW5QD.mjs";
46
51
  import "./chunk-USLFXFFH.mjs";
47
52
  import "./chunk-E257KFBU.mjs";
48
53
  import "./chunk-7MABZJIM.mjs";
@@ -54,8 +59,10 @@ import {
54
59
  loadFarmConfigFile,
55
60
  resolveFarmLayers
56
61
  } from "./chunk-74YTBPTY.mjs";
57
- import "./chunk-7ZVN3YZI.mjs";
58
62
  import "./chunk-GY2STC2S.mjs";
63
+ import "./chunk-7ZVN3YZI.mjs";
64
+ import "./chunk-4E6VRJ6P.mjs";
65
+ import "./chunk-GXASWWJU.mjs";
59
66
  import {
60
67
  DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT,
61
68
  ServerActionRequestError,
@@ -69,10 +76,9 @@ import {
69
76
  sanitizeServerActionError,
70
77
  validateServerActionRequest
71
78
  } from "./chunk-WORFTBLU.mjs";
79
+ import "./chunk-H53KVQUU.mjs";
72
80
  import "./chunk-ZVWA4ZQ3.mjs";
73
81
  import "./chunk-7FBJLMQH.mjs";
74
- import "./chunk-4E6VRJ6P.mjs";
75
- import "./chunk-GXASWWJU.mjs";
76
82
  import "./chunk-CRN3AH35.mjs";
77
83
  import {
78
84
  createFarmStorage,
@@ -140,9 +146,10 @@ import {
140
146
  import "./chunk-LM2YNO4U.mjs";
141
147
  import {
142
148
  FARM_VERSION
143
- } from "./chunk-DAUR3WUZ.mjs";
149
+ } from "./chunk-5NOVWCFL.mjs";
144
150
  import "./chunk-B3FFOIWS.mjs";
145
151
  import "./chunk-ITN462YM.mjs";
152
+ import "./chunk-GQVQESLY.mjs";
146
153
  import "./chunk-3HIVDX7J.mjs";
147
154
  import "./chunk-JK25YEN6.mjs";
148
155
  import "./chunk-GS6K5OCM.mjs";
@@ -313,7 +320,6 @@ async function createServer(config = {}) {
313
320
  try {
314
321
  const tailwindcss = (await import("@tailwindcss/vite")).default;
315
322
  tailwindVitePlugin = tailwindcss();
316
- logger.info("\u{1F4E6} Enabled built-in Tailwind support (@tailwindcss/vite)");
317
323
  } catch (error) {
318
324
  logger.warn(
319
325
  `Tailwind plugin auto-enable failed; continuing without it: ${error.message}`
@@ -326,6 +332,7 @@ async function createServer(config = {}) {
326
332
  root: projectRoot,
327
333
  css: shouldUseProjectPostcss ? void 0 : { postcss: { plugins: [] } },
328
334
  plugins: [
335
+ createFarmThemeCssPlugin(finalConfig.theme, finalConfig.basePath),
329
336
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
330
337
  createDevDependencyStubsPlugin(),
331
338
  farmI18nClientBridgePlugin(),
@@ -470,6 +477,8 @@ export {
470
477
  getServerActionInvalidations,
471
478
  getServerActionSignal,
472
479
  getStorage,
480
+ getTheme,
481
+ getThemeSnapshot,
473
482
  globFiles,
474
483
  initStorage,
475
484
  invalidate,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/server/create-server.ts"],"sourcesContent":["import { createServer as createViteServer, type ViteDevServer } from \"vite\";\nimport type { FarmConfig } from \"../types\";\nimport { farmI18nClientBridgePlugin, farmPlugin } from \"../vite\";\nimport { logger } from \"../utils\";\nimport { loadConfig, resolveConfig } from \"../config\";\nimport { PluginManager } from \"../plugin\";\nimport { farmEnvironmentFunctionsPlugin } from \"../environment-vite\";\nimport fs from \"fs\";\nimport path from \"path\";\nimport {\n createRedirectsPlugin,\n createHeadersPlugin,\n createRewritesPlugin,\n createCompressionPlugin,\n createLoggerPlugin,\n} from \"../plugins\";\nimport {\n createFarmClientOptimizeDepsConfig,\n createFarmClientOptimizeDepsEntries,\n mergeFarmViteConfig,\n} from \"./vite-config\";\nimport { FARM_VERSION } from \"../version\";\nimport { getFarmAppDirectories } from \"../layers\";\nimport { createCliColors } from \"../cli-colors\";\n\nexport const DEFAULT_FARM_DEV_SERVER_PORT = 3000;\n\n// Farm.js branding plugin for createServer\nfunction createBrandingPlugin() {\n let serverStarted = false;\n let startTime = Date.now();\n\n return {\n name: \"farm:branding\",\n enforce: \"pre\" as const,\n configureServer(server: ViteDevServer) {\n startTime = Date.now();\n\n const originalListen = server.listen.bind(server);\n server.listen = async (port?: number, ...args: any[]) => {\n const result = await originalListen(port, ...args);\n if (!serverStarted) {\n serverStarted = true;\n const elapsed = Date.now() - startTime;\n const address = server.httpServer?.address();\n const resolvedPort =\n typeof address === \"object\" && address\n ? address.port\n : server.config.server.port || port || 3000;\n\n const pc = createCliColors();\n console.log(\"\");\n console.log(\n ` ${pc.bold(pc.green(\"Farm.js\"))} ${pc.dim(`v${FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`,\n );\n console.log(\"\");\n console.log(\n ` ${pc.dim(\"➜\")} ${pc.bold(\"Local:\")} ${pc.cyan(`http://localhost:${resolvedPort}/`)}`,\n );\n console.log(` ${pc.dim(\"➜\")} ${pc.bold(\"Network:\")} ${pc.dim(\"use --host to expose\")}`);\n console.log(\"\");\n }\n return result;\n };\n },\n };\n}\n\nfunction hasProjectPostcssConfig(root: string): boolean {\n const candidates = [\n \"postcss.config.js\",\n \"postcss.config.cjs\",\n \"postcss.config.mjs\",\n \"postcss.config.ts\",\n \"postcss.config.json\",\n \".postcssrc\",\n \".postcssrc.json\",\n \".postcssrc.js\",\n \".postcssrc.cjs\",\n \".postcssrc.mjs\",\n \".postcssrc.ts\",\n ];\n\n return candidates.some((file) => fs.existsSync(path.join(root, file)));\n}\n\nfunction createDevDependencyStubsPlugin() {\n const stubs: Record<string, string> = {\n \"supports-color\":\n \"const disabled = false; export default { stdout: disabled, stderr: disabled }; export const stdout = disabled; export const stderr = disabled;\",\n };\n\n return {\n name: \"farm:dev-dependency-stubs\",\n enforce: \"pre\" as const,\n resolveId(id: string) {\n if (id in stubs) {\n return `\\0farm-dev-dependency-stub:${id}`;\n }\n return null;\n },\n load(id: string) {\n if (!id.startsWith(\"\\0farm-dev-dependency-stub:\")) {\n return null;\n }\n\n const moduleName = id.slice(\"\\0farm-dev-dependency-stub:\".length);\n return stubs[moduleName] || null;\n },\n };\n}\n\n/**\n * Create a Vite development server with Farm.js integration\n */\nexport async function createServer(config: FarmConfig = {}) {\n let pluginManager: PluginManager | null = null;\n try {\n const root = config.root || process.cwd();\n\n // Load farm.config.ts if it exists\n const mode = process.env.NODE_ENV === \"production\" ? \"production\" : \"development\";\n const userConfig = await loadConfig(root, undefined, mode);\n\n const resolvedConfig = userConfig ? await resolveConfig(userConfig, mode) : null;\n\n // Initialize plugin manager\n pluginManager = new PluginManager({\n config: resolvedConfig || config,\n isDev: mode === \"development\",\n isProd: mode === \"production\",\n });\n\n // Add built-in plugins if config is available\n if (resolvedConfig) {\n const redirects = await resolvedConfig.redirects();\n const headers = await resolvedConfig.headers();\n const rewrites = await resolvedConfig.rewrites();\n\n if (redirects.length > 0) {\n pluginManager.addPlugin(createRedirectsPlugin(redirects));\n }\n\n if (headers.length > 0) {\n pluginManager.addPlugin(createHeadersPlugin(headers));\n }\n\n if (rewrites.length > 0) {\n pluginManager.addPlugin(createRewritesPlugin(rewrites));\n }\n\n // Compression is applied by production adapters. Its hook is a no-op in\n // development, so do not put every dev response through that lifecycle.\n if (resolvedConfig.compress && mode === \"production\") {\n pluginManager.addPlugin(createCompressionPlugin());\n }\n\n if (resolvedConfig.plugins) {\n pluginManager.addPlugins(resolvedConfig.plugins);\n }\n }\n\n if (mode === \"development\") {\n const hasLogger = pluginManager.getPlugins().some((p) => p.name === \"farm:logger\");\n if (!hasLogger) {\n pluginManager.addPlugin(createLoggerPlugin());\n }\n }\n\n // Run config hooks\n await pluginManager.runHookParallel(\"init\");\n\n let finalConfig = resolvedConfig || config;\n finalConfig = await pluginManager.runHookSerial(\"config\", finalConfig);\n const projectRoot = finalConfig.root || process.cwd();\n\n let tailwindVitePlugin: any = undefined;\n const shouldUseProjectPostcss = hasProjectPostcssConfig(projectRoot);\n if (shouldUseProjectPostcss) {\n logger.info(\"📦 Using project PostCSS/Tailwind configuration\");\n } else {\n try {\n const tailwindcss = (await import(\"@tailwindcss/vite\")).default;\n tailwindVitePlugin = tailwindcss();\n logger.info(\"📦 Enabled built-in Tailwind support (@tailwindcss/vite)\");\n } catch (error) {\n logger.warn(\n `Tailwind plugin auto-enable failed; continuing without it: ${(error as Error).message}`,\n );\n }\n }\n\n const server = await createViteServer(\n mergeFarmViteConfig(\n {\n root: projectRoot,\n css: shouldUseProjectPostcss ? undefined : { postcss: { plugins: [] } },\n plugins: [\n ...(tailwindVitePlugin ? [tailwindVitePlugin] : []),\n createDevDependencyStubsPlugin(),\n farmI18nClientBridgePlugin(),\n farmPlugin(finalConfig, pluginManager),\n farmEnvironmentFunctionsPlugin(),\n createBrandingPlugin(),\n ],\n server: {\n middlewareMode: false,\n port: DEFAULT_FARM_DEV_SERVER_PORT,\n strictPort: true,\n },\n resolve: {\n // Keep framework and application modules on one React runtime.\n dedupe: [\"react\", \"react-dom\"],\n },\n optimizeDeps: {\n ...createFarmClientOptimizeDepsConfig(\n createFarmClientOptimizeDepsEntries(projectRoot, getFarmAppDirectories(finalConfig)),\n ),\n exclude: [\n \"@farm.js/core/server\",\n \"@farm.js/core/api\",\n \"@farm.js/core/middleware\",\n \"@farm.js/core/config\",\n \"nitro\",\n \"h3\",\n \"vite\",\n \"esbuild\",\n \"rollup\",\n \"fsevents\",\n \"nf3\",\n \"better-call\",\n \"zod\",\n \"supports-color\",\n \"node-fetch\",\n \"consola\",\n \"mock-aws-s3\",\n \"aws-sdk\",\n \"nock\",\n \"lightningcss\",\n \"@tailwindcss/oxide\",\n ],\n },\n ssr: {\n noExternal: [\"farm\"],\n },\n customLogger: {\n info: () => {},\n warn: () => {},\n warnOnce: () => {},\n error: (msg) => logger.error(String(msg)),\n clearScreen: () => {},\n hasErrorLogged: () => false,\n hasWarned: false,\n },\n },\n finalConfig.vite,\n ),\n );\n\n (server as any).__farmPluginManager = pluginManager;\n\n // Update plugin manager with vite server\n pluginManager.updateContext({ config: finalConfig, viteServer: server });\n await pluginManager.setupPlugins();\n await pluginManager.runHookParallel(\"devServerCreated\", server);\n\n // Run configResolved hooks\n await pluginManager.runHookParallel(\"configResolved\", finalConfig);\n\n // Run buildStart hooks\n await pluginManager.runHookParallel(\"buildStart\");\n\n return server;\n } catch (error) {\n if (pluginManager) {\n await pluginManager.runHookParallel(\"onError\", {\n phase: \"createServer\",\n error,\n });\n }\n logger.error(`Failed to create server: ${error}`);\n throw error;\n }\n}\n\n/**\n * Start the development server\n */\nexport async function startDevServer(config: FarmConfig = {}, port?: number) {\n const server = await createServer(config);\n await server.listen(port);\n const pluginManager = (server as any).__farmPluginManager as PluginManager | undefined;\n if (pluginManager) {\n await pluginManager.startRuntime();\n server.httpServer?.once(\"close\", () => {\n pluginManager.closeRuntime(\"dev-server-closed\").catch(() => {});\n });\n }\n // Branding is handled by farmBrandingPlugin in vite.ts\n return server;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,gBAAgB,wBAA4C;AAOrE,OAAO,QAAQ;AACf,OAAO,UAAU;AAiBV,IAAM,+BAA+B;AAG5C,SAAS,uBAAuB;AAC9B,MAAI,gBAAgB;AACpB,MAAI,YAAY,KAAK,IAAI;AAEzB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,gBAAgB,QAAuB;AACrC,kBAAY,KAAK,IAAI;AAErB,YAAM,iBAAiB,OAAO,OAAO,KAAK,MAAM;AAChD,aAAO,SAAS,OAAO,SAAkB,SAAgB;AACvD,cAAM,SAAS,MAAM,eAAe,MAAM,GAAG,IAAI;AACjD,YAAI,CAAC,eAAe;AAClB,0BAAgB;AAChB,gBAAM,UAAU,KAAK,IAAI,IAAI;AAC7B,gBAAM,UAAU,OAAO,YAAY,QAAQ;AAC3C,gBAAM,eACJ,OAAO,YAAY,YAAY,UAC3B,QAAQ,OACR,OAAO,OAAO,OAAO,QAAQ,QAAQ;AAE3C,gBAAM,KAAK,gBAAgB;AAC3B,kBAAQ,IAAI,EAAE;AACd,kBAAQ;AAAA,YACN,KAAK,GAAG,KAAK,GAAG,MAAM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AAA,UACA,cAAc;AAAA,YACZ,MAAM,6BAAM;AAAA,YAAC,GAAP;AAAA,YACN,MAAM,6BAAM;AAAA,YAAC,GAAP;AAAA,YACN,UAAU,6BAAM;AAAA,YAAC,GAAP;AAAA,YACV,OAAO,wBAAC,QAAQ,OAAO,MAAM,OAAO,GAAG,CAAC,GAAjC;AAAA,YACP,aAAa,6BAAM;AAAA,YAAC,GAAP;AAAA,YACb,gBAAgB,6BAAM,OAAN;AAAA,YAChB,WAAW;AAAA,UACb;AAAA,QACF;AAAA,QACA,YAAY;AAAA,MACd;AAAA,IACF;AAEA,IAAC,OAAe,sBAAsB;AAGtC,kBAAc,cAAc,EAAE,QAAQ,aAAa,YAAY,OAAO,CAAC;AACvE,UAAM,cAAc,aAAa;AACjC,UAAM,cAAc,gBAAgB,oBAAoB,MAAM;AAG9D,UAAM,cAAc,gBAAgB,kBAAkB,WAAW;AAGjE,UAAM,cAAc,gBAAgB,YAAY;AAEhD,WAAO;AAAA,EACT,SAAS,OAAO;AACd,QAAI,eAAe;AACjB,YAAM,cAAc,gBAAgB,WAAW;AAAA,QAC7C,OAAO;AAAA,QACP;AAAA,MACF,CAAC;AAAA,IACH;AACA,WAAO,MAAM,4BAA4B,KAAK,EAAE;AAChD,UAAM;AAAA,EACR;AACF;AAxKsB;AA6KtB,eAAsB,eAAe,SAAqB,CAAC,GAAG,MAAe;AAC3E,QAAM,SAAS,MAAM,aAAa,MAAM;AACxC,QAAM,OAAO,OAAO,IAAI;AACxB,QAAM,gBAAiB,OAAe;AACtC,MAAI,eAAe;AACjB,UAAM,cAAc,aAAa;AACjC,WAAO,YAAY,KAAK,SAAS,MAAM;AACrC,oBAAc,aAAa,mBAAmB,EAAE,MAAM,MAAM;AAAA,MAAC,CAAC;AAAA,IAChE,CAAC;AAAA,EACH;AAEA,SAAO;AACT;AAZsB;","names":[]}
1
+ {"version":3,"sources":["../src/server/create-server.ts"],"sourcesContent":["import { createServer as createViteServer, type ViteDevServer } from \"vite\";\nimport type { FarmConfig } from \"../types\";\nimport { farmI18nClientBridgePlugin, farmPlugin } from \"../vite\";\nimport { logger } from \"../utils\";\nimport { loadConfig, resolveConfig } from \"../config\";\nimport { PluginManager } from \"../plugin\";\nimport { farmEnvironmentFunctionsPlugin } from \"../environment-vite\";\nimport fs from \"fs\";\nimport path from \"path\";\nimport {\n createRedirectsPlugin,\n createHeadersPlugin,\n createRewritesPlugin,\n createCompressionPlugin,\n createLoggerPlugin,\n} from \"../plugins\";\nimport {\n createFarmClientOptimizeDepsConfig,\n createFarmClientOptimizeDepsEntries,\n mergeFarmViteConfig,\n} from \"./vite-config\";\nimport { FARM_VERSION } from \"../version\";\nimport { getFarmAppDirectories } from \"../layers\";\nimport { createCliColors } from \"../cli-colors\";\nimport { createFarmThemeCssPlugin } from \"../theme/vite\";\n\nexport const DEFAULT_FARM_DEV_SERVER_PORT = 3000;\n\n// Farm.js branding plugin for createServer\nfunction createBrandingPlugin() {\n let serverStarted = false;\n let startTime = Date.now();\n\n return {\n name: \"farm:branding\",\n enforce: \"pre\" as const,\n configureServer(server: ViteDevServer) {\n startTime = Date.now();\n\n const originalListen = server.listen.bind(server);\n server.listen = async (port?: number, ...args: any[]) => {\n const result = await originalListen(port, ...args);\n if (!serverStarted) {\n serverStarted = true;\n const elapsed = Date.now() - startTime;\n const address = server.httpServer?.address();\n const resolvedPort =\n typeof address === \"object\" && address\n ? address.port\n : server.config.server.port || port || 3000;\n\n const pc = createCliColors();\n console.log(\"\");\n console.log(\n ` ${pc.bold(pc.green(\"Farm.js\"))} ${pc.dim(`v${FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`,\n );\n console.log(\"\");\n console.log(\n ` ${pc.dim(\"➜\")} ${pc.bold(\"Local:\")} ${pc.cyan(`http://localhost:${resolvedPort}/`)}`,\n );\n console.log(` ${pc.dim(\"➜\")} ${pc.bold(\"Network:\")} ${pc.dim(\"use --host to expose\")}`);\n console.log(\"\");\n }\n return result;\n };\n },\n };\n}\n\nfunction hasProjectPostcssConfig(root: string): boolean {\n const candidates = [\n \"postcss.config.js\",\n \"postcss.config.cjs\",\n \"postcss.config.mjs\",\n \"postcss.config.ts\",\n \"postcss.config.json\",\n \".postcssrc\",\n \".postcssrc.json\",\n \".postcssrc.js\",\n \".postcssrc.cjs\",\n \".postcssrc.mjs\",\n \".postcssrc.ts\",\n ];\n\n return candidates.some((file) => fs.existsSync(path.join(root, file)));\n}\n\nfunction createDevDependencyStubsPlugin() {\n const stubs: Record<string, string> = {\n \"supports-color\":\n \"const disabled = false; export default { stdout: disabled, stderr: disabled }; export const stdout = disabled; export const stderr = disabled;\",\n };\n\n return {\n name: \"farm:dev-dependency-stubs\",\n enforce: \"pre\" as const,\n resolveId(id: string) {\n if (id in stubs) {\n return `\\0farm-dev-dependency-stub:${id}`;\n }\n return null;\n },\n load(id: string) {\n if (!id.startsWith(\"\\0farm-dev-dependency-stub:\")) {\n return null;\n }\n\n const moduleName = id.slice(\"\\0farm-dev-dependency-stub:\".length);\n return stubs[moduleName] || null;\n },\n };\n}\n\n/**\n * Create a Vite development server with Farm.js integration\n */\nexport async function createServer(config: FarmConfig = {}) {\n let pluginManager: PluginManager | null = null;\n try {\n const root = config.root || process.cwd();\n\n // Load farm.config.ts if it exists\n const mode = process.env.NODE_ENV === \"production\" ? \"production\" : \"development\";\n const userConfig = await loadConfig(root, undefined, mode);\n\n const resolvedConfig = userConfig ? await resolveConfig(userConfig, mode) : null;\n\n // Initialize plugin manager\n pluginManager = new PluginManager({\n config: resolvedConfig || config,\n isDev: mode === \"development\",\n isProd: mode === \"production\",\n });\n\n // Add built-in plugins if config is available\n if (resolvedConfig) {\n const redirects = await resolvedConfig.redirects();\n const headers = await resolvedConfig.headers();\n const rewrites = await resolvedConfig.rewrites();\n\n if (redirects.length > 0) {\n pluginManager.addPlugin(createRedirectsPlugin(redirects));\n }\n\n if (headers.length > 0) {\n pluginManager.addPlugin(createHeadersPlugin(headers));\n }\n\n if (rewrites.length > 0) {\n pluginManager.addPlugin(createRewritesPlugin(rewrites));\n }\n\n // Compression is applied by production adapters. Its hook is a no-op in\n // development, so do not put every dev response through that lifecycle.\n if (resolvedConfig.compress && mode === \"production\") {\n pluginManager.addPlugin(createCompressionPlugin());\n }\n\n if (resolvedConfig.plugins) {\n pluginManager.addPlugins(resolvedConfig.plugins);\n }\n }\n\n if (mode === \"development\") {\n const hasLogger = pluginManager.getPlugins().some((p) => p.name === \"farm:logger\");\n if (!hasLogger) {\n pluginManager.addPlugin(createLoggerPlugin());\n }\n }\n\n // Run config hooks\n await pluginManager.runHookParallel(\"init\");\n\n let finalConfig = resolvedConfig || config;\n finalConfig = await pluginManager.runHookSerial(\"config\", finalConfig);\n const projectRoot = finalConfig.root || process.cwd();\n\n let tailwindVitePlugin: any = undefined;\n const shouldUseProjectPostcss = hasProjectPostcssConfig(projectRoot);\n if (shouldUseProjectPostcss) {\n logger.info(\"📦 Using project PostCSS/Tailwind configuration\");\n } else {\n try {\n const tailwindcss = (await import(\"@tailwindcss/vite\")).default;\n tailwindVitePlugin = tailwindcss();\n } catch (error) {\n logger.warn(\n `Tailwind plugin auto-enable failed; continuing without it: ${(error as Error).message}`,\n );\n }\n }\n\n const server = await createViteServer(\n mergeFarmViteConfig(\n {\n root: projectRoot,\n css: shouldUseProjectPostcss ? undefined : { postcss: { plugins: [] } },\n plugins: [\n createFarmThemeCssPlugin(finalConfig.theme, finalConfig.basePath),\n ...(tailwindVitePlugin ? [tailwindVitePlugin] : []),\n createDevDependencyStubsPlugin(),\n farmI18nClientBridgePlugin(),\n farmPlugin(finalConfig, pluginManager),\n farmEnvironmentFunctionsPlugin(),\n createBrandingPlugin(),\n ],\n server: {\n middlewareMode: false,\n port: DEFAULT_FARM_DEV_SERVER_PORT,\n strictPort: true,\n },\n resolve: {\n // Keep framework and application modules on one React runtime.\n dedupe: [\"react\", \"react-dom\"],\n },\n optimizeDeps: {\n ...createFarmClientOptimizeDepsConfig(\n createFarmClientOptimizeDepsEntries(projectRoot, getFarmAppDirectories(finalConfig)),\n ),\n exclude: [\n \"@farm.js/core/server\",\n \"@farm.js/core/api\",\n \"@farm.js/core/middleware\",\n \"@farm.js/core/config\",\n \"nitro\",\n \"h3\",\n \"vite\",\n \"esbuild\",\n \"rollup\",\n \"fsevents\",\n \"nf3\",\n \"better-call\",\n \"zod\",\n \"supports-color\",\n \"node-fetch\",\n \"consola\",\n \"mock-aws-s3\",\n \"aws-sdk\",\n \"nock\",\n \"lightningcss\",\n \"@tailwindcss/oxide\",\n ],\n },\n ssr: {\n noExternal: [\"farm\"],\n },\n customLogger: {\n info: () => {},\n warn: () => {},\n warnOnce: () => {},\n error: (msg) => logger.error(String(msg)),\n clearScreen: () => {},\n hasErrorLogged: () => false,\n hasWarned: false,\n },\n },\n finalConfig.vite,\n ),\n );\n\n (server as any).__farmPluginManager = pluginManager;\n\n // Update plugin manager with vite server\n pluginManager.updateContext({ config: finalConfig, viteServer: server });\n await pluginManager.setupPlugins();\n await pluginManager.runHookParallel(\"devServerCreated\", server);\n\n // Run configResolved hooks\n await pluginManager.runHookParallel(\"configResolved\", finalConfig);\n\n // Run buildStart hooks\n await pluginManager.runHookParallel(\"buildStart\");\n\n return server;\n } catch (error) {\n if (pluginManager) {\n await pluginManager.runHookParallel(\"onError\", {\n phase: \"createServer\",\n error,\n });\n }\n logger.error(`Failed to create server: ${error}`);\n throw error;\n }\n}\n\n/**\n * Start the development server\n */\nexport async function startDevServer(config: FarmConfig = {}, port?: number) {\n const server = await createServer(config);\n await server.listen(port);\n const pluginManager = (server as any).__farmPluginManager as PluginManager | undefined;\n if (pluginManager) {\n await pluginManager.startRuntime();\n server.httpServer?.once(\"close\", () => {\n pluginManager.closeRuntime(\"dev-server-closed\").catch(() => {});\n });\n }\n // Branding is handled by farmBrandingPlugin in vite.ts\n return server;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC,OAAe,sBAAsB;AAGtC,kBAAc,cAAc,EAAE,QAAQ,aAAa,YAAY,OAAO,CAAC;AACvE,UAAM,cAAc,aAAa;AACjC,UAAM,cAAc,gBAAgB,oBAAoB,MAAM;AAG9D,UAAM,cAAc,gBAAgB,kBAAkB,WAAW;AAGjE,UAAM,cAAc,gBAAgB,YAAY;AAEhD,WAAO;AAAA,EACT,SAAS,OAAO;AACd,QAAI,eAAe;AACjB,YAAM,cAAc,gBAAgB,WAAW;AAAA,QAC7C,OAAO;AAAA,QACP;AAAA,MACF,CAAC;AAAA,IACH;AACA,WAAO,MAAM,4BAA4B,KAAK,EAAE;AAChD,UAAM;AAAA,EACR;AACF;AAxKsB;AA6KtB,eAAsB,eAAe,SAAqB,CAAC,GAAG,MAAe;AAC3E,QAAM,SAAS,MAAM,aAAa,MAAM;AACxC,QAAM,OAAO,OAAO,IAAI;AACxB,QAAM,gBAAiB,OAAe;AACtC,MAAI,eAAe;AACjB,UAAM,cAAc,aAAa;AACjC,WAAO,YAAY,KAAK,SAAS,MAAM;AACrC,oBAAc,aAAa,mBAAmB,EAAE,MAAM,MAAM;AAAA,MAAC,CAAC;AAAA,IAChE,CAAC;AAAA,EACH;AAEA,SAAO;AACT;AAZsB;","names":[]}
@@ -4,7 +4,7 @@ import { b as APIRouteParams } from './runtime-Q3u74Nbq.mjs';
4
4
  import { ProgrammaticPageRoute, InferProgrammaticRouteData, ProgrammaticRouteComponentProps, ProgrammaticApiRoute } from './routes.mjs';
5
5
  import { FarmRouterQueryValue, FarmRouterPathParams } from './router.mjs';
6
6
  import { ServerFn } from './server-fn.mjs';
7
- import { g as FarmContextFactory, M as MiddlewareProps, i as PluginContextProps, s as RouteModule } from './client-plugins-QQntVkrv.mjs';
7
+ import { g as FarmContextFactory, M as MiddlewareProps, i as PluginContextProps, s as RouteModule } from './client-plugins-CCilIb_G.mjs';
8
8
  import './cache.mjs';
9
9
  import './transport-BmbGTXA5.mjs';
10
10
  import './route-runtime-DoOHzCAD.mjs';
@@ -26,6 +26,7 @@ import './env.mjs';
26
26
  import './server-action-security.mjs';
27
27
  import './server-fn-error-DDh14a0V.mjs';
28
28
  import './image-config-Duob7wER.mjs';
29
+ import './types-CsR8fpgF.mjs';
29
30
  import './font.mjs';
30
31
 
31
32
  type FarmTestQuery = URLSearchParams | Record<string, FarmRouterQueryValue>;
package/dist/testing.d.ts CHANGED
@@ -4,7 +4,7 @@ import { b as APIRouteParams } from './runtime-Bpp-c28k.js';
4
4
  import { ProgrammaticPageRoute, InferProgrammaticRouteData, ProgrammaticRouteComponentProps, ProgrammaticApiRoute } from './routes.js';
5
5
  import { FarmRouterQueryValue, FarmRouterPathParams } from './router.js';
6
6
  import { ServerFn } from './server-fn.js';
7
- import { g as FarmContextFactory, M as MiddlewareProps, i as PluginContextProps, s as RouteModule } from './client-plugins-CbRum1fj.js';
7
+ import { g as FarmContextFactory, M as MiddlewareProps, i as PluginContextProps, s as RouteModule } from './client-plugins-DuuleQKk.js';
8
8
  import './cache.js';
9
9
  import './transport-BmbGTXA5.js';
10
10
  import './route-runtime-DoOHzCAD.js';
@@ -26,6 +26,7 @@ import './env.js';
26
26
  import './server-action-security.js';
27
27
  import './server-fn-error-DDh14a0V.js';
28
28
  import './image-config-Duob7wER.js';
29
+ import './types-CsR8fpgF.js';
29
30
  import './font.js';
30
31
 
31
32
  type FarmTestQuery = URLSearchParams | Record<string, FarmRouterQueryValue>;
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+
22
+ // src/theme/client.tsx
23
+ var client_exports = {};
24
+ __export(client_exports, {
25
+ getTheme: () => getTheme,
26
+ setTheme: () => setTheme,
27
+ toggleTheme: () => toggleTheme,
28
+ useTheme: () => useTheme
29
+ });
30
+ module.exports = __toCommonJS(client_exports);
31
+ var import_react = require("react");
32
+
33
+ // src/theme/bridge.ts
34
+ var FALLBACK_SERVER_SNAPSHOT = Object.freeze({
35
+ theme: "system",
36
+ resolvedTheme: void 0,
37
+ mounted: false
38
+ });
39
+ var FARM_THEME_SERVER_SNAPSHOT_RESOLVER = /* @__PURE__ */ Symbol.for("farm.js.theme.server-snapshot-resolver");
40
+ function getFarmThemeServerSnapshot() {
41
+ return globalThis[FARM_THEME_SERVER_SNAPSHOT_RESOLVER]?.() ?? FALLBACK_SERVER_SNAPSHOT;
42
+ }
43
+ __name(getFarmThemeServerSnapshot, "getFarmThemeServerSnapshot");
44
+
45
+ // src/theme/client.tsx
46
+ var FALLBACK_CLIENT_SNAPSHOT = Object.freeze({
47
+ theme: "system",
48
+ resolvedTheme: "light",
49
+ mounted: true
50
+ });
51
+ var cachedClientSnapshot = FALLBACK_CLIENT_SNAPSHOT;
52
+ function snapshotsMatch(left, right) {
53
+ return left.theme === right.theme && left.resolvedTheme === right.resolvedTheme && left.mounted === right.mounted;
54
+ }
55
+ __name(snapshotsMatch, "snapshotsMatch");
56
+ function getClientSnapshot() {
57
+ const next = typeof window === "undefined" ? FALLBACK_CLIENT_SNAPSHOT : window.__FARM_THEME__?.snapshot;
58
+ if (!next) return cachedClientSnapshot;
59
+ if (!snapshotsMatch(cachedClientSnapshot, next)) cachedClientSnapshot = next;
60
+ return cachedClientSnapshot;
61
+ }
62
+ __name(getClientSnapshot, "getClientSnapshot");
63
+ function getHydrationSnapshot() {
64
+ if (typeof window !== "undefined" && window.__FARM_THEME__?.serverSnapshot) {
65
+ return window.__FARM_THEME__.serverSnapshot;
66
+ }
67
+ return getFarmThemeServerSnapshot();
68
+ }
69
+ __name(getHydrationSnapshot, "getHydrationSnapshot");
70
+ function subscribe(listener) {
71
+ if (typeof window === "undefined") return () => {
72
+ };
73
+ const handleThemeChange = /* @__PURE__ */ __name(() => {
74
+ getClientSnapshot();
75
+ listener();
76
+ }, "handleThemeChange");
77
+ window.addEventListener("farm:themechange", handleThemeChange);
78
+ return () => window.removeEventListener("farm:themechange", handleThemeChange);
79
+ }
80
+ __name(subscribe, "subscribe");
81
+ function getTheme() {
82
+ return getClientSnapshot();
83
+ }
84
+ __name(getTheme, "getTheme");
85
+ function setTheme(theme) {
86
+ const runtime = typeof window === "undefined" ? void 0 : window.__FARM_THEME__;
87
+ if (!runtime) {
88
+ throw new Error("The FARMJS theme runtime is not enabled. Add `theme` to farm.config.ts.");
89
+ }
90
+ runtime.setTheme(theme);
91
+ }
92
+ __name(setTheme, "setTheme");
93
+ function toggleTheme() {
94
+ const next = getClientSnapshot().resolvedTheme === "dark" ? "light" : "dark";
95
+ setTheme(next);
96
+ return next;
97
+ }
98
+ __name(toggleTheme, "toggleTheme");
99
+ function useTheme() {
100
+ const snapshot = (0, import_react.useSyncExternalStore)(subscribe, getClientSnapshot, getHydrationSnapshot);
101
+ return {
102
+ ...snapshot,
103
+ setTheme,
104
+ toggleTheme
105
+ };
106
+ }
107
+ __name(useTheme, "useTheme");
108
+ // Annotate the CommonJS export names for ESM import in node:
109
+ 0 && (module.exports = {
110
+ getTheme,
111
+ setTheme,
112
+ toggleTheme,
113
+ useTheme
114
+ });
115
+ //# sourceMappingURL=client.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/theme/client.tsx","../../src/theme/bridge.ts"],"sourcesContent":["\"use client\";\n\nimport { useSyncExternalStore } from \"react\";\nimport { getFarmThemeServerSnapshot } from \"./bridge\";\nimport type {\n FarmThemePreference,\n FarmThemeRuntime,\n FarmThemeSnapshot,\n FarmResolvedTheme,\n} from \"./types\";\n\ndeclare global {\n interface Window {\n __FARM_THEME__?: FarmThemeRuntime;\n }\n}\n\nconst FALLBACK_CLIENT_SNAPSHOT: FarmThemeSnapshot = Object.freeze({\n theme: \"system\",\n resolvedTheme: \"light\",\n mounted: true,\n});\n\nlet cachedClientSnapshot = FALLBACK_CLIENT_SNAPSHOT;\n\nfunction snapshotsMatch(left: FarmThemeSnapshot, right: FarmThemeSnapshot): boolean {\n return (\n left.theme === right.theme &&\n left.resolvedTheme === right.resolvedTheme &&\n left.mounted === right.mounted\n );\n}\n\nfunction getClientSnapshot(): FarmThemeSnapshot {\n const next =\n typeof window === \"undefined\" ? FALLBACK_CLIENT_SNAPSHOT : window.__FARM_THEME__?.snapshot;\n if (!next) return cachedClientSnapshot;\n if (!snapshotsMatch(cachedClientSnapshot, next)) cachedClientSnapshot = next;\n return cachedClientSnapshot;\n}\n\nfunction getHydrationSnapshot(): FarmThemeSnapshot {\n if (typeof window !== \"undefined\" && window.__FARM_THEME__?.serverSnapshot) {\n return window.__FARM_THEME__.serverSnapshot;\n }\n return getFarmThemeServerSnapshot();\n}\n\nfunction subscribe(listener: () => void): () => void {\n if (typeof window === \"undefined\") return () => {};\n const handleThemeChange = () => {\n getClientSnapshot();\n listener();\n };\n window.addEventListener(\"farm:themechange\", handleThemeChange);\n return () => window.removeEventListener(\"farm:themechange\", handleThemeChange);\n}\n\nexport function getTheme(): FarmThemeSnapshot {\n return getClientSnapshot();\n}\n\nexport function setTheme(theme: FarmThemePreference): void {\n const runtime = typeof window === \"undefined\" ? undefined : window.__FARM_THEME__;\n if (!runtime) {\n throw new Error(\"The FARMJS theme runtime is not enabled. Add `theme` to farm.config.ts.\");\n }\n runtime.setTheme(theme);\n}\n\nexport function toggleTheme(): FarmResolvedTheme {\n const next = getClientSnapshot().resolvedTheme === \"dark\" ? \"light\" : \"dark\";\n setTheme(next);\n return next;\n}\n\nexport interface UseThemeResult extends FarmThemeSnapshot {\n setTheme(theme: FarmThemePreference): void;\n toggleTheme(): FarmResolvedTheme;\n}\n\nexport function useTheme(): UseThemeResult {\n const snapshot = useSyncExternalStore(subscribe, getClientSnapshot, getHydrationSnapshot);\n return {\n ...snapshot,\n setTheme,\n toggleTheme,\n };\n}\n","import type { FarmThemeSnapshot } from \"./types\";\n\nconst FALLBACK_SERVER_SNAPSHOT: FarmThemeSnapshot = Object.freeze({\n theme: \"system\",\n resolvedTheme: undefined,\n mounted: false,\n});\n\nconst FARM_THEME_SERVER_SNAPSHOT_RESOLVER = Symbol.for(\"farm.js.theme.server-snapshot-resolver\");\n\ntype FarmThemeBridgeGlobal = typeof globalThis & {\n [FARM_THEME_SERVER_SNAPSHOT_RESOLVER]?: () => FarmThemeSnapshot;\n};\n\nexport function _setFarmThemeServerSnapshotResolver(resolver: () => FarmThemeSnapshot): void {\n (globalThis as FarmThemeBridgeGlobal)[FARM_THEME_SERVER_SNAPSHOT_RESOLVER] = resolver;\n}\n\nexport function getFarmThemeServerSnapshot(): FarmThemeSnapshot {\n return (\n (globalThis as FarmThemeBridgeGlobal)[FARM_THEME_SERVER_SNAPSHOT_RESOLVER]?.() ??\n FALLBACK_SERVER_SNAPSHOT\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAqC;;;ACArC,IAAM,2BAA8C,OAAO,OAAO;AAAA,EAChE,OAAO;AAAA,EACP,eAAe;AAAA,EACf,SAAS;AACX,CAAC;AAED,IAAM,sCAAsC,uBAAO,IAAI,wCAAwC;AAUxF,SAAS,6BAAgD;AAC9D,SACG,WAAqC,mCAAmC,IAAI,KAC7E;AAEJ;AALgB;;;ADDhB,IAAM,2BAA8C,OAAO,OAAO;AAAA,EAChE,OA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;AAAA,IACA;AAAA,EACF;AACF;AAPgB;","names":[]}
@@ -0,0 +1,17 @@
1
+ import { F as FarmThemeRuntime, a as FarmThemeSnapshot, b as FarmThemePreference, c as FarmResolvedTheme } from '../types-CsR8fpgF.mjs';
2
+
3
+ declare global {
4
+ interface Window {
5
+ __FARM_THEME__?: FarmThemeRuntime;
6
+ }
7
+ }
8
+ declare function getTheme(): FarmThemeSnapshot;
9
+ declare function setTheme(theme: FarmThemePreference): void;
10
+ declare function toggleTheme(): FarmResolvedTheme;
11
+ interface UseThemeResult extends FarmThemeSnapshot {
12
+ setTheme(theme: FarmThemePreference): void;
13
+ toggleTheme(): FarmResolvedTheme;
14
+ }
15
+ declare function useTheme(): UseThemeResult;
16
+
17
+ export { type UseThemeResult, getTheme, setTheme, toggleTheme, useTheme };
@@ -0,0 +1,17 @@
1
+ import { F as FarmThemeRuntime, a as FarmThemeSnapshot, b as FarmThemePreference, c as FarmResolvedTheme } from '../types-CsR8fpgF.js';
2
+
3
+ declare global {
4
+ interface Window {
5
+ __FARM_THEME__?: FarmThemeRuntime;
6
+ }
7
+ }
8
+ declare function getTheme(): FarmThemeSnapshot;
9
+ declare function setTheme(theme: FarmThemePreference): void;
10
+ declare function toggleTheme(): FarmResolvedTheme;
11
+ interface UseThemeResult extends FarmThemeSnapshot {
12
+ setTheme(theme: FarmThemePreference): void;
13
+ toggleTheme(): FarmResolvedTheme;
14
+ }
15
+ declare function useTheme(): UseThemeResult;
16
+
17
+ export { type UseThemeResult, getTheme, setTheme, toggleTheme, useTheme };
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import {
3
+ getTheme,
4
+ setTheme,
5
+ toggleTheme,
6
+ useTheme
7
+ } from "../chunk-D42BNPZH.mjs";
8
+ import "../chunk-GQVQESLY.mjs";
9
+ import "../chunk-CGILA3WO.mjs";
10
+ export {
11
+ getTheme,
12
+ setTheme,
13
+ toggleTheme,
14
+ useTheme
15
+ };
16
+ //# sourceMappingURL=client.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/theme/index.ts
22
+ var theme_exports = {};
23
+ __export(theme_exports, {
24
+ resolveFarmThemeConfig: () => resolveFarmThemeConfig
25
+ });
26
+ module.exports = __toCommonJS(theme_exports);
27
+
28
+ // src/theme/config.ts
29
+ var DEFAULT_FARM_THEME_STORAGE_KEY = "farm-theme";
30
+ var STORAGE_KEY_PATTERN = /^[A-Za-z0-9._-]+$/;
31
+ function resolveFarmThemeConfig(config, basePath = "/") {
32
+ if (config && "enabled" in config) {
33
+ return config;
34
+ }
35
+ if (!config) {
36
+ return {
37
+ enabled: false,
38
+ default: "system",
39
+ storageKey: DEFAULT_FARM_THEME_STORAGE_KEY,
40
+ cookiePath: normalizeCookiePath(basePath)
41
+ };
42
+ }
43
+ const storageKey = config.storageKey?.trim() || DEFAULT_FARM_THEME_STORAGE_KEY;
44
+ if (!STORAGE_KEY_PATTERN.test(storageKey)) {
45
+ throw new Error(
46
+ "theme.storageKey may only contain letters, numbers, dots, underscores, and hyphens."
47
+ );
48
+ }
49
+ const defaultTheme = config.default ?? "system";
50
+ if (defaultTheme !== "light" && defaultTheme !== "dark" && defaultTheme !== "system") {
51
+ throw new Error('theme.default must be "light", "dark", or "system".');
52
+ }
53
+ return {
54
+ enabled: true,
55
+ default: defaultTheme,
56
+ storageKey,
57
+ cookiePath: normalizeCookiePath(basePath)
58
+ };
59
+ }
60
+ __name(resolveFarmThemeConfig, "resolveFarmThemeConfig");
61
+ function normalizeCookiePath(basePath) {
62
+ const normalized = `/${basePath}`.replace(/\/{2,}/g, "/");
63
+ if (normalized === "/") return normalized;
64
+ return normalized.replace(/\/$/, "");
65
+ }
66
+ __name(normalizeCookiePath, "normalizeCookiePath");
67
+ // Annotate the CommonJS export names for ESM import in node:
68
+ 0 && (module.exports = {
69
+ resolveFarmThemeConfig
70
+ });
71
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/theme/index.ts","../../src/theme/config.ts"],"sourcesContent":["export { resolveFarmThemeConfig } from \"./config\";\nexport type {\n FarmResolvedTheme,\n FarmThemeConfig,\n FarmThemePreference,\n FarmThemeSnapshot,\n ResolvedFarmThemeConfig,\n} from \"./types\";\n","import type { FarmThemeConfig, ResolvedFarmThemeConfig } from \"./types\";\n\nexport const DEFAULT_FARM_THEME_STORAGE_KEY = \"farm-theme\";\n\nconst STORAGE_KEY_PATTERN = /^[A-Za-z0-9._-]+$/;\n\nexport function resolveFarmThemeConfig(\n config: FarmThemeConfig | ResolvedFarmThemeConfig | false | undefined,\n basePath = \"/\",\n): ResolvedFarmThemeConfig {\n if (config && \"enabled\" in config) {\n return config;\n }\n\n if (!config) {\n return {\n enabled: false,\n default: \"system\",\n storageKey: DEFAULT_FARM_THEME_STORAGE_KEY,\n cookiePath: normalizeCookiePath(basePath),\n };\n }\n\n const storageKey = config.storageKey?.trim() || DEFAULT_FARM_THEME_STORAGE_KEY;\n if (!STORAGE_KEY_PATTERN.test(storageKey)) {\n throw new Error(\n \"theme.storageKey may only contain letters, numbers, dots, underscores, and hyphens.\",\n );\n }\n\n const defaultTheme = config.default ?? \"system\";\n if (defaultTheme !== \"light\" && defaultTheme !== \"dark\" && defaultTheme !== \"system\") {\n throw new Error('theme.default must be \"light\", \"dark\", or \"system\".');\n }\n\n return {\n enabled: true,\n default: defaultTheme,\n storageKey,\n cookiePath: normalizeCookiePath(basePath),\n };\n}\n\nfunction normalizeCookiePath(basePath: string): string {\n const normalized = `/${basePath}`.replace(/\\/{2,}/g, \"/\");\n if (normalized === \"/\") return normalized;\n return normalized.replace(/\\/$/, \"\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAM,iCAAiC;AAE9C,IAAM,sBAAsB;AAErB,SAAS,uBACd,QACA,WAAW,KACc;AACzB,MAAI,UAAU,aAAa,QAAQ;AACjC,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,MACL,SAAS;AAAA,MACT,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,YAAY,oBAAoB,QAAQ;AAAA,IAC1C;AAAA,EACF;AAEA,QAAM,aAAa,OAAO,YAAY,KAAK,KAAK;AAChD,MAAI,CAAC,oBAAoB,KAAK,UAAU,GAAG;AACzC,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,eAAe,OAAO,WAAW;AACvC,MAAI,iBAAiB,WAAW,iBAAiB,UAAU,iBAAiB,UAAU;AACpF,UAAM,IAAI,MAAM,qDAAqD;AAAA,EACvE;AAEA,SAAO;AAAA,IACL,SAAS;AAAA,IACT,SAAS;AAAA,IACT;AAAA,IACA,YAAY,oBAAoB,QAAQ;AAAA,EAC1C;AACF;AAnCgB;AAqChB,SAAS,oBAAoB,UAA0B;AACrD,QAAM,aAAa,IAAI,QAAQ,GAAG,QAAQ,WAAW,GAAG;AACxD,MAAI,eAAe,IAAK,QAAO;AAC/B,SAAO,WAAW,QAAQ,OAAO,EAAE;AACrC;AAJS;","names":[]}
@@ -0,0 +1,6 @@
1
+ import { d as FarmThemeConfig, R as ResolvedFarmThemeConfig } from '../types-CsR8fpgF.mjs';
2
+ export { c as FarmResolvedTheme, b as FarmThemePreference, a as FarmThemeSnapshot } from '../types-CsR8fpgF.mjs';
3
+
4
+ declare function resolveFarmThemeConfig(config: FarmThemeConfig | ResolvedFarmThemeConfig | false | undefined, basePath?: string): ResolvedFarmThemeConfig;
5
+
6
+ export { FarmThemeConfig, ResolvedFarmThemeConfig, resolveFarmThemeConfig };
@@ -0,0 +1,6 @@
1
+ import { d as FarmThemeConfig, R as ResolvedFarmThemeConfig } from '../types-CsR8fpgF.js';
2
+ export { c as FarmResolvedTheme, b as FarmThemePreference, a as FarmThemeSnapshot } from '../types-CsR8fpgF.js';
3
+
4
+ declare function resolveFarmThemeConfig(config: FarmThemeConfig | ResolvedFarmThemeConfig | false | undefined, basePath?: string): ResolvedFarmThemeConfig;
5
+
6
+ export { FarmThemeConfig, ResolvedFarmThemeConfig, resolveFarmThemeConfig };
@@ -0,0 +1,9 @@
1
+ import "../chunk-HCGQYYHI.mjs";
2
+ import {
3
+ resolveFarmThemeConfig
4
+ } from "../chunk-H53KVQUU.mjs";
5
+ import "../chunk-CGILA3WO.mjs";
6
+ export {
7
+ resolveFarmThemeConfig
8
+ };
9
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}