Converts to monorepo, mainly so demos can use the master version of jsondiffpatch instead of using a URL. New directory structure is:
packages/jsondiffpatch
demos/console-demo
demos/html-demo
demos/numeric-plugin-demo
Revamp build system
Remove bundling with Rollup in favor of just transpiling the modules using TypeScript
Switch to ESM-only. The ecosystem has enough ESM-only packages, that consumers should know how to deal with it at this point.
Add "exports" field to "package.json"
Use esbuild to bundle code for html-demo
Remove formatter exports from main entry-point. This allows using jsondiffpatch without depending on DOM types from the HTML formatter, and excludes importing chalk by default (fixes https://github.com/benjamine/jsondiffpatch/issues/323).
Breaking changes for consumers
ESM-only
No default export. Import using import * as jsondiffpatch from 'jsondiffpatch or import individual methods.
Formatters must be imported from subpaths:
import * as annotatedFormatter from 'jsondiffpatch/formatters/annotated';
import * as baseFormatter from 'jsondiffpatch/formatters/base';
import * as consoleFormatter from 'jsondiffpatch/formatters/console';
import * as htmlFormatter from 'jsondiffpatch/formatters/html';
import * as jsonpatchFormatter from 'jsondiffpatch/formatters/jsonpatch';
Main code changes
master
version of jsondiffpatch instead of using a URL. New directory structure is:packages/jsondiffpatch
demos/console-demo
demos/html-demo
demos/numeric-plugin-demo
html-demo
Breaking changes for consumers
import * as jsondiffpatch from 'jsondiffpatch
or import individual methods.import * as annotatedFormatter from 'jsondiffpatch/formatters/annotated';
import * as baseFormatter from 'jsondiffpatch/formatters/base';
import * as consoleFormatter from 'jsondiffpatch/formatters/console';
import * as htmlFormatter from 'jsondiffpatch/formatters/html';
import * as jsonpatchFormatter from 'jsondiffpatch/formatters/jsonpatch';
import 'jsondiffpatch/formatters/styles/html.css';
import 'jsondiffpatch/formatters/styles/annotated.css';
^18.0.0 || >=20.0.0
Remaining work before next release