@contentina/core
v0.1.1
Published
Localized content graph compiler core for Contentina.
Readme
@contentina/core
Localized content graph compiler for TypeScript applications.
The heart of Contentina — schema-portable collections, processors, native localization, locale-aware references, routes, assets, generated helpers, and Orama search.
Use defineContentinaModel() when collections and singletons need centrally
declared, type-safe relationships and graph-aware transforms. Exact types flow
through data collections, optional and required singletons, derived groups,
build results, and granular generated modules.
Install
bun add @contentina/coreQuick start
Create a contentina.config.ts at your project root:
import {
defineConfig,
defineLocales,
defineCollection,
} from "@contentina/core";
export default defineConfig({
locales: defineLocales({
default: "en",
locales: ["en", "de"],
}),
collections: {
posts: defineCollection({
source: "content/{en,de}/posts/*.{md,mdx}",
// schema, routes, processors...
}),
},
});Import generated output from your app:
import posts, { getPost } from "contentina/generated/collections/posts";
import type { Post } from "contentina/generated";Use a framework adapter (@contentina/vite, @contentina/next, …) to build, watch, and wire the contentina/generated alias automatically.
Part of Contentina · npm
