@appberry/berryeditor
v3.0.0
Published
BerryEditor Rich Text Editor
Downloads
49
Readme
BerryEditor
BerryEditor is a React-first rich text editor built with a TypeScript editor engine and HTML as the canonical content format, designed for apps that need customizable authoring controls and predictable HTML persistence.
What This Repo Contains
BerryEditor/
packages/berryeditor Publishable package (`@appberry/berryeditor`) with React components, editor engine, styles, and tests.
apps/docs Next.js docs/playground app with App Router and Pages Router integration examples.Prerequisites
- Node.js
>=20 - Corepack (recommended by pnpm for project-pinned package manager versions)
pnpm
engines.node in package.json is advisory by default in npm unless users enable engine-strict, so verify local Node before running workspace scripts.
Environment Setup (Corepack + pnpm)
This workspace pins [email protected] via the root packageManager field. The pnpm installation docs recommend using Corepack so contributors use the expected pnpm version.
npm install --global corepack@latest
corepack enable pnpm
pnpm --versionIf Corepack reports outdated signatures, update Corepack and run corepack enable pnpm again.
Quick Start (Contributors)
pnpm install
pnpm devpnpm dev starts the docs app used for local development and manual testing.
Development Commands
pnpm buildbuilds all workspace packages and apps.pnpm lintruns ESLint across the workspace.pnpm typecheckruns TypeScript checks with--noEmit.pnpm testruns workspace test suites (Vitest-based package tests plus app placeholders).pnpm test:e2eruns Playwright editor E2E tests via the docs app.
Testing Strategy
- Unit and integration tests are implemented with Vitest in
packages/berryeditor/tests. - End-to-end coverage is implemented with Playwright in
packages/berryeditor/tests/e2eagainst the docs app runtime.
Documentation and Examples
- Package usage and API docs:
packages/berryeditor/README.md - Local integration references in the docs app:
- App Router example:
/app-router - Pages Router example:
/pages-router
- App Router example:
- Official docs used by this repo:
- pnpm installation and Corepack usage: https://pnpm.io/installation
- npm
package.jsonfields (engines,packageManager): https://docs.npmjs.com/cli/v11/configuring-npm/package-json - Next.js client component boundary (
'use client'): https://nextjs.org/docs/app/api-reference/directives/use-client - Next.js transpiling external/workspace packages: https://nextjs.org/docs/pages/api-reference/config/next-config-js/transpilePackages
License
Apache-2.0
