Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 1.74 KB

File metadata and controls

42 lines (31 loc) · 1.74 KB

AGENTS.md

Guidance for AI coding agents working in this repository.

Project

@y/codemirror — CodeMirror 6 binding for Yjs. Binds a Y.Text to a CodeMirror editor and provides awareness (remote cursors/selections) and a shared undo manager as separate plugins.

Layout

  • src/index.js — public entry point
  • src/y-sync.js — Y.Text ↔ CodeMirror sync plugin
  • src/y-remote-selections.js — remote cursor/selection rendering via awareness
  • src/y-undomanager.js — shared undo/redo integration with Y.UndoManager
  • src/y-range.js — range helpers
  • test/ — test entry (test/index.js) and node runner (test/test.node.cjs)
  • demo/ — browser demo
  • dist/ — build output (generated, do not edit)

Commands

  • npm run dist — clean build via rollup + emit types with tsc
  • npm test — build then run node tests (test/test.node.cjs)
  • npm run test-extensive — longer fuzz run (--production --repetition-time 10000)
  • npm run lintstandard + tsc --skipLibCheck
  • npm run watch — rollup watch
  • npm start — demo server + watch
  • npm run debugtest.html + watch

Conventions

  • ESM source ("type": "module"), CJS output for require consumers
  • Lint style: standard (no semicolons, single quotes)
  • Types via JSDoc + tsc --skipLibCheck (no .ts source)
  • Peer deps: @y/y, @y/protocols, @codemirror/state, @codemirror/view — do not import transitively; treat as host-provided
  • Tests use the lib0 testing framework (lib0/testing, lib0/prng) — see the lib0-testing skill

Before finishing a change

  1. npm run lint
  2. npm test
  3. Do not commit dist/ churn unless the change is intentional — build output is regenerated by preversion