server.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * @json-render/next/server — Server-safe exports
  3. *
  4. * This entry point does not import any client components or React hooks.
  5. * Safe to use in:
  6. * - Server Components
  7. * - API routes
  8. * - Build scripts
  9. * - Server Actions
  10. *
  11. * @example
  12. * ```ts
  13. * import { createNextApp, schema } from "@json-render/next/server";
  14. * ```
  15. */
  16. // createNextApp (main API)
  17. export { createNextApp } from "./create-app";
  18. // Schema (Next.js app spec format)
  19. export { schema, type NextSchema, type NextSpec } from "./schema";
  20. // Router utilities
  21. export { matchRoute, slugToPath, collectStaticParams } from "./router";
  22. // Metadata resolution
  23. export { resolveMetadata, type ResolvedMetadata } from "./metadata";
  24. // Types
  25. export type {
  26. NextAppSpec,
  27. NextRouteSpec,
  28. NextMetadata,
  29. MatchedRoute,
  30. LoaderFn,
  31. CreateNextAppOptions,
  32. NextAppExports,
  33. PageData,
  34. } from "./types";
  35. // Catalog types (type-only, no runtime)
  36. export type {
  37. EventHandle,
  38. BaseComponentProps,
  39. SetState,
  40. StateModel,
  41. ComponentContext,
  42. ComponentFn,
  43. Components,
  44. ActionFn,
  45. Actions,
  46. } from "./catalog-types";
  47. // Core types (re-exported for convenience)
  48. export type { Spec, StateStore } from "@json-render/core";