Getting started
Installation
Requirements, peer dependencies and the npm install command for @skaile/forge-editor.
Prerequisites
- Node ≥ 22 and Bun (the repository is a Bun workspace:
packages/*,examples/*). - A Vite- or Nuxt-based app (
@vitejs/plugin-vue/@vitejs/plugin-react, or Nuxt). The published package is a built ESM package: everyexportssubpath resolves todist/**/*.jswith.d.ts(Vue SFCs are compiled, React.tsxis compiled to JSX-runtime JS), the CSS sheets are copied, and the source maps embed the sources (srcitself is not published). Output is one module per source file, so entries stay tree-shakeable. - Required peer dependencies (install them in the consuming app so the host and the library share one instance of each):
@tiptap/core,@tiptap/pm,yjs,@hocuspocus/provider. Yjs and the provider are required peers because shared prop types in the.d.tsreference them; a simple-editor bundle does not contain their implementation (proven in the bundle isolation proof). Per layer (all optional peers): Vuevue,@nuxt/ui,@tiptap/vue-3; Reactreact,react-dom,@tiptap/react,@iconify/react; code surface (/code)@codemirror/state,@codemirror/view,@codemirror/language,@codemirror/commands,@codemirror/search,@lezer/highlight, plus the@codemirror/lang-*packs you register (the package ships none). - Tailwind CSS 4 (
tailwindcss) for the Nuxt UI theme (Vue) or the shadcn classes (React), and the icon collection@iconify-json/lucide. React hosts also needtw-animate-css(enter/exit animations of the dialog, dropdown and tooltip).
Install
From npmjs (public, no token and no .npmrc needed):
npm install @skaile/forge-editor # or: bun add @skaile/forge-editor / pnpm add @skaile/forge-editor
Inside this repository the package is a workspace member, so consumers there declare "@skaile/forge-editor": "workspace:*".