@ruxt/editor
@ruxt/editor
Public Nuxt source layer containing route-free source-editing and CV-preview primitives shared by Ruxt applications.
Boundary
This package owns:
- the CodeMirror Markdown/CSS editor and editor commands;
- sanitized CV Markdown rendering and scoped preview CSS;
- measured, ancestor-preserving A4 pagination;
- the runtime dependencies required by these primitives.
It owns no routes, layouts, authentication, storage, template lifecycle, or application API calls. Product-specific workspaces remain in their respective applications. The package tarball includes the complete app/ tree and Nuxt config so internal relative utilities and assets resolve; inclusion does not make every file a public import path.
Consumption
Add @ruxt/editor as a dependency and extend it from the consuming Nuxt config. Consuming apps also provide declared CodeMirror peer dependencies so Vite resolves a single copy of @codemirror/state; loading multiple copies breaks CodeMirror extension identity checks.
export default defineNuxtConfig({
extends: ["@ruxt/editor"],
})
Nuxt discovers CodeMirror and CodePreview as components. Intentional package subpath APIs include useCodeMirror types and renderCvMarkdownToHtml:
import type { EditorStats } from "@ruxt/editor/composables/useCodeMirror"
import { renderCvMarkdownToHtml } from "@ruxt/editor/utils/cvMarkdown"
Internal utilities such as cvPagination are not public package subpaths. CodeMirror accepts optional highlights (CodeMirrorHighlight[]: from, to, extra class, title) and exposes revealRange(from, to).
CodePreview paginates sanitized Markdown into styled physical A4 .cv-sheet elements. The host owns fit/zoom controls and can observe sheet counts or listen for the bubbling cv-pagination-complete event (detail.pages); data-pagination-state is pending or ready.
Dedicated pagination unit tests run from the repository root with pnpm exec vitest run --config packages/editor/vitest.config.ts. Browser/export regressions use the consuming application's local test harness.
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.1.2 | ^3.5.32 | ||
| 0.1.1 | ^3.5.32 | ||
| 0.1.0 | ^3.5.32 |