Skip to content

Latest commit

 

History

History
90 lines (68 loc) · 3.53 KB

File metadata and controls

90 lines (68 loc) · 3.53 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

Koenig is Ghost's editor based on the Lexical framework. This is a Lerna-managed monorepo containing multiple packages for Ghost's content editing ecosystem.

Package management

This project uses Yarn for package management.

Key Commands

Setup and Development

yarn setup              # Initial setup: install deps, link packages, build all
yarn dev                # Run koenig-lexical in standalone mode (localhost:5173)
yarn test               # Run tests across all packages (delegates to lerna run test)
yarn lint               # Run ESLint across all packages
yarn ship               # Publish packages to npm (Ghost team only)

Package-specific Development

yarn workspace @tryghost/koenig-lexical dev    # Same as yarn dev

Testing (from koenig-lexical package)

yarn test:unit          # Vitest unit tests
yarn test:e2e           # Playwright e2e tests
yarn test:e2e:headed    # E2E tests with browser UI (for debugging)

Architecture

Core Packages

Legacy Packages

Utility Packages

Standalone Editor Development Workflow

Run yarn dev to develop the editor independently at http://localhost:5173

Code Style

  • Uses Tailwind CSS classes where possible
  • All styles scoped under .koenig-lexical class
  • SVGs imported as React components
  • PostCSS nesting for style organization

Testing

  • Unit tests: Vitest framework in test/unit/
  • E2E tests: Playwright in test/e2e/
  • Demo app built before tests run
  • Use -t flag to filter tests by keyword

Package Dependencies

Packages have complex interdependencies. Key relationships:

  • koenig-lexical depends on kg-default-nodes, kg-lexical-html-renderer, kg-html-to-lexical
  • Transformation packages depend on kg-utils

Special Configuration

Environment Variables

  • VITE_KLIPY_API_KEY: Required for Gif card functionality (preferred provider)
  • VITE_TENOR_API_KEY: Required for Gif card functionality (fallback when Klipy key is not set)
  • VITE_SENTRY_*: Error tracking configuration

External Dependencies

  • Bookmark/Embed cards require CORS enabled for development
  • Uses Lerna for monorepo management
  • ESLint configuration via eslint-plugin-ghost