Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@cogita/core

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cogita/core

The intelligent core engine that orchestrates Cogita's theme-driven architecture.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

@cogita/core

npm version License: MIT

中文 | English

The intelligent core engine that orchestrates Cogita's theme-driven architecture.

What is it?

@cogita/core is the brain of the Cogita framework. It automatically loads themes, manages plugins, and provides a type-safe configuration system that makes building a blog as simple as choosing a theme.

Key Features

  • 🎨 Theme-Driven: Themes automatically load their required plugins
  • ⚙️ Type-Safe Config: Full TypeScript support with intelligent defaults
  • 🔧 Zero Config: Works out-of-the-box, customizable when needed
  • Rspress Powered: Built on the fast and modern Rspress foundation

Quick Start

Installation

pnpm add @cogita/core @cogita/theme-lucid

Basic Usage

Create cogita.config.ts:

import { defineConfig } from '@cogita/core';

export default defineConfig({
  site: {
    title: 'My Blog',
    description: 'A blog built with Cogita',
  },
  theme: 'lucid', // Theme handles everything else!
});

Create your first post in posts/hello.md:

---
title: "Hello Cogita!"
createDate: "2024-01-01"
---

# Welcome to my blog!

Start development:

pnpm dev

That's it! Your blog is ready at http://localhost:3000.

How It Works

  • Load Config: Reads your cogita.config.ts
  • Load Theme: Automatically loads the specified theme
  • Register Plugins: Theme declares its plugin dependencies
  • Generate Config: Creates optimized Rspress configuration
  • Build/Serve: Powers your blog with Rspress

Configuration

Basic Site Config

export default defineConfig({
  site: {
    title: 'My Blog',           // Site title
    description: 'My awesome blog',  // Meta description
    base: '/blog/',             // Base URL (for subpaths)
  },
  theme: 'lucid',              // Theme name
});

Advanced Configuration

export default defineConfig({
  site: { /* ... */ },
  theme: 'lucid',
  
  // Pass-through to Rspress theme config
  themeConfig: {
    nav: [
      { text: 'Home', link: '/' },
      { text: 'About', link: '/about' },
    ],
    socialLinks: [
      { icon: 'github', mode: 'link', content: 'https://github.com/you' }
    ],
  },
  
  // Pass-through to Rspress build config
  builderConfig: {
    output: { assetPrefix: 'https://cdn.example.com/' }
  },
});

API Reference

defineConfig(config: CogitaConfig)

Type-safe configuration helper.

loadCogitaConfig(root?: string)

Load configuration from project directory.

Main Types

interface CogitaConfig {
  site?: {
    title?: string;
    description?: string; 
    base?: string;
  };
  theme?: string;
  themeConfig?: any;    // Rspress theme config
  builderConfig?: any;  // Rspress builder config
}

Available Themes

  • lucid (default) - Clean, content-focused blog theme
  • More themes coming soon...

Development Commands

# Development
pnpm dev

# Build 
pnpm build

# Preview build
pnpm preview

Learn More

License

MIT © wu9o

Keywords

cogita

FAQs

Package last updated on 04 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts