Directory structure:
BlockNote
├── packages/core - The core of the editor, which includes all logic to get the editor running in vanilla JS.
├── packages/react - A React wrapper and UI for the editor. Requires additional components for the UI.
├── packages/ariakit - UI components for the `react` package, made with Ariakit.
├── packages/mantine - UI components for the `react` package, made with Mantine.
├── packages/shadcn - UI components for the `react` package, made with Shadcn.
├── packages/server-util - Utilities for converting BlockNote documents into static HTML for server-side rendering.
├── packages/dev-scripts - A set of tools for converting example editor setups into components for the BlockNote website.
├── examples - Example editor setups used for demos in the BlockNote website and playground.
├── docs - Code for the BlockNote website.
├── playground - A basic page where you can quickly test each of the example editor setups.
└── tests - Playwright end to end tests.
An introduction into the BlockNote Prosemirror schema can be found in packages/core/src/pm-nodes/README.md.
To run the project, open the command line in the project's root directory and enter the following commands:
# Install all required npm modules
pnpm install
# Start the example project
pnpm devAll commands are run from the project root with pnpm, which
wraps the vp (vite-plus) task runner. The ones you'll
use day to day:
| Command | Description |
|---|---|
pnpm install |
Install all dependencies. |
pnpm dev |
Start the example editor with live reload. |
pnpm start |
Build the packages, then preview the example editor. |
pnpm test |
Run the unit tests across all packages. |
pnpm lint |
Lint and type-check the codebase. Run this before pushing. |
pnpm run check |
Auto-fix lint and formatting issues across the project. |
pnpm build |
Build all packages. |
vp run e2e |
Run the full browser suite in Docker. |
To run the unit tests for a single package, run pnpm test from inside that
package's directory; append -u to update snapshots.
The unfiltered local browser run reuses iframes and uses two workers per desktop browser. The native clipboard smoke test runs separately because the OS clipboard is shared.
Use BLOCKNOTE_E2E_PARALLEL_REUSE=0 vp run e2e to compare against the legacy
runner. Filtered runs, CI, and vp run e2e:updateSnaps keep their existing
behavior.
If a cold browser run reports React hook errors or a reload during a test, use
bash tests/docker-run.sh -e CI=1 -e DEBUG=vite:deps -- --run <file> --retry=0.
Look for optimized dependencies changed. reloading in the output. If a late
import triggers the reload, add that import to optimizeDeps.include in
tests/vite.config.browser.ts and rerun in a fresh container. Startup
optimization by itself is normal.
- Add the dependency to the relevant
package.jsonfile (packages/xxx/package.json) - Double check
pnpm-lock.yamlto make sure only the relevant packages have been affected
Run pnpm knip from the repository root to audit unused files, dependencies,
and exports. Use pnpm knip --dependencies for dependency findings or
pnpm knip --workspace packages/core to focus on a workspace and its related
workspaces.
CI runs Knip as a separate, non-blocking report. On a pull request, open Checks → Knip report to read it. Review findings before removing code: published exports can have consumers outside this repository, and dependencies can be loaded by build scripts, CSS, or framework conventions. The audit focuses on the packages and their supporting tooling and tests. The docs, playground, and standalone StackBlitz example workspaces are excluded.
| Package | Size | Version |
|---|---|---|
| @blocknote/core | ||
| @blocknote/react | ||
| @blocknote/ariakit | ||
| @blocknote/mantine | ||
| @blocknote/shadcn | ||
| @blocknote/server-util |
All packages under packages/ are released in lockstep (same version).
- You must be on the
mainbranch with a clean working tree - CI must be green
- NPM trusted publishing must be configured for all public packages (see below)
Run the interactive release script:
vp run deployThe script will:
- Verify preconditions (clean tree, on main, up to date with origin)
- Present an interactive version picker (patch / minor / major / prerelease / custom) via bumpp
- Bump the version in all
packages/*/package.jsonfiles - Sync the lockfile
- Run a smoke test build (
vp run -r build) - Generate a changelog from conventional commits via changelogen
- Open
$EDITORso you can review and edit the changelog before committing - Commit, tag (
v{version}), and push
Once the tag is pushed, the CI publish workflow automatically:
- Builds all packages
- Publishes the 13 public packages to npm with OIDC provenance
- Creates a GitHub Release with the changelog content
Each public @blocknote/* package must have a trusted publisher configured on npmjs.com:
- Go to
https://www.npmjs.com/package/@blocknote/{name}/access - Under "Trusted Publisher", select GitHub Actions
- Set: Owner =
TypeCellOS, Repo =BlockNote, Workflow =publish.yaml
No NPM_TOKEN secret is needed — publishing uses GitHub's OIDC tokens.
When adding a new public package to the monorepo:
- Ensure its
package.jsonhas"private": falseand arepositoryfield pointing to the BlockNote repo - Configure a trusted publisher for it on npmjs.com (see above)
- The next release will automatically include it in the publish loop