Skip to content

v6.0.0

Choose a tag to compare

@stefanoverna stefanoverna released this 25 May 10:26
· 17 commits to main since this release

The breaking change lives in datocms-html-to-structured-text; the other packages have no behavior changes.

datocms-html-to-structured-text (breaking)

  • ESM-only. require('datocms-html-to-structured-text') no longer works — consume via import (native ESM, a bundler, or TypeScript with module: "NodeNext"). If you need CommonJS, pin to ^5.1.16.
  • Minimum Node.js is 18.
  • All upstream hast/unist/parse5 deps upgraded to their current ESM-only majors (rehype-minify-whitespace 6, hast-util-* 3–8, parse5 8, unist-util-visit replaces unist-utils-core).
  • The HastNode, HastElementNode, HastRootNode, HastTextNode, and HastProperties type aliases were removed — import the equivalents (Nodes, Element, Root, Text, Properties) from @types/hast.
  • parse5ToStructuredText's parameter type changed from parse5.Document to DefaultTreeAdapterMap['document'] (parse5 v8 dropped the namespace export).
  • parse5 v8 has no default export — use import { parse } from 'parse5'.
  • The preprocess hook is now typed as (hast: Root) => void; mutate the tree in place.
  • Manual .d.ts shims under src/typings/ are gone — every upstream dep now ships its own types.

Other packages

All other packages (datocms-structured-text-utils, datocms-to-html-string, datocms-to-dom-nodes, datocms-to-plain-text, datocms-contentful-to-structured-text, datocms-slate-utils, datocms-generic-html-renderer, datocms-dastdown) are republished at 6.0.0 for version-alignment under lerna fixed mode. No source or runtime changes.

Internal tooling

  • Bumped typescript 4.1 → 5.4, jest 26 → 29, ts-jest 26 → 29, eslint 7 → 8, @typescript-eslint/* 4 → 8.