@tryghost/kg-default-transforms
v1.3.8
Published
Shared Lexical node transforms for Ghost's Koenig editor
Maintainers
Keywords
Readme
Koenig Default Transforms
Lexical node transforms shared between the editor and the server, such as denesting and list merging.
Install
npm install @tryghost/kg-default-transforms
Usage
const {registerDefaultTransforms} = require('@tryghost/kg-default-transforms');
const teardown = registerDefaultTransforms(editor);Returns a teardown function that unregisters every transform it added.
Individual transforms are also exported by name for cases that need a subset.
registerRemoveAtLinkNodesTransform is deliberately not part of the defaults —
it is only wanted when rendering.
Develop
This package is part of the Ghost monorepo
and resolves through the pnpm workspace — there is no linking or per-package
install step. Run pnpm bootstrap in the monorepo root, then work in
koenig/kg-default-transforms.
See the Koenig README for the shared build, test and release workflow.
Test
pnpm test:unitruns the unit testspnpm testruns the unit and type tests, including coverage thresholdspnpm lintruns the lint checks
Copyright & License
Copyright (c) 2013-2026 Ghost Foundation - Released under the MIT license.
