Package exports Every manicjs entry point and how it maps to subpath imports.
The manicjs package exposes multiple subpath exports (package.json "exports"). Prefer importing from the smallest surface you need (manicjs/router, manicjs/config, …). The root entry (manicjs) bundles the pieces most apps use in one place.
Import path Role Detailed docs manicjsRouter + UI shells + theme + transitions + typed config surface + RPC client This page + Router , Theme , Transitions , Errors , Client manicjs/routerFull router surface including extras not on the root barrel Router , preloadRoute manicjs/configConfig authoring, plugin helper, cached config (getConfig) Config , Plugins manicjs/serverProduction/dev Bun server (createManicServer) Server manicjs/themeTheme context + toggle (+ initTheme) Theme manicjs/transitionsViewTransitions.* elements + navigate / setViewTransitions re-exportsTransitions manicjs/envgetEnv, getPublicEnvEnvironment manicjs/clientAlias of config client — RPC helper only Client , RPC manicjs/pluginsLow-level loaders (apiLoaderPlugin, fileImporterPlugin) Plugin loaders
The manic CLI is shipped as the package binary (package.json "bin"); it is not a runtime import.
These symbols are re-exported from packages/manic/index.ts — convenient for app code (main.tsx, route modules).
Export Notes Router, Link, navigate, useRouter, useQueryParamsClient SPA routing (Router ) NotFound, ErrorOverlay, ServerErrorDefault error UI (Errors ) defineConfig, loadConfigSame implementations as manicjs/config; types ManicConfig, ManicPlugin, contexts, PageRoute, ApiRoute (Config ) ThemeProvider, useTheme, ThemeToggle(Theme ) ViewTransitions, setViewTransitions(Transitions ) createClientHono RPC client — identical to manicjs/client (RPC )
Not re-exported from the root (import from manicjs/router or manicjs/config instead):
preloadRoute, RouterContext, setViewTransitions (also on manicjs/router), type-only RouteDef, RouterContextValue
createPlugin, getConfig, ManicProvider, BuildContext, SitemapConfig, and the rest of the config module API
Export Notes Router, Link, navigate, useRouter, useQueryParamsSame as root preloadRouteManual route chunk preload (preloadRoute ) setViewTransitionsSame as manicjs / manicjs/transitions RouterContextReact context backing useRouter RouteDef, RouterContextValueTypes
Export Notes defineConfig, loadConfig, getConfigConfig load + cache (Config ) createPluginPlugin authoring with staticFiles shorthand (Plugins ) ManicConfig, ManicPlugin, ManicPluginContext, ManicServerPluginContext, ManicBuildPluginContextTypes ManicProvider, BuildContextDeployment provider authoring PageRoute, ApiRoute, SitemapConfigDiscovery / plugin types
Export Notes createManicServerBun Bun.serve wrapper used from ~manic.ts (Server )
Export Notes ThemeProvider, useTheme, ThemeToggleRuntime theme UI initThemeEarly boot helper (apply persisted/system theme before paint)
Export Notes ViewTransitionsElement factory (ViewTransitions.div, …) navigate, setViewTransitionsRe-exported from the router implementation
Export Notes getEnv, getPublicEnvBuild-time public vars + server secrets (Environment )
Export Notes createClientSame as root — points at src/config/client.ts (RPC )
See Plugin loaders : apiLoaderPlugin, fileImporterPlugin.
// Typical app components — shortest path
import { Link, useRouter, ViewTransitions } from 'manicjs' ;
// When you need preloadRoute or RouterContext
import { preloadRoute, RouterContext } from 'manicjs/router' ;
// manic.config.ts — always config entry
import { defineConfig, createPlugin } from 'manicjs/config' ;
If something is exported from manicjs and a subpath, either import works; bundlers dedupe to one module instance.