Files
Robert Fleischmann 5ff9261ec2 fix: restore 2.x compatibility for easing, data-* precedence and dist paths
Three things that worked in 2.1.7 were broken by the 3.0 rewrite. Found by
running real 2.x usage patterns against the published package rather than
against the test suite, which only ever asserted 3.x behaviour.

An `easing` string threw "options.easing is not a function" inside every
requestAnimationFrame callback, so the chart never animated and the console
filled with errors. 2.x resolved the name against jQuery.easing and fell back
to the default easing for anything it could not resolve — including when
jQuery was absent — so no string ever reached the renderer. That is restored.
The 2.x five-argument signature (chart, t, b, c, d), which is also jQuery
UI's, is detected by arity and supported alongside the modern four-argument
form.

data-* attributes lost to the options object. The 2.x jQuery plugin merged
them the other way round, $.extend({}, options, $(this).data()), which is what
makes shared JS defaults with per-element overrides work. Reversing it meant
a page of charts sharing one barColor and ignoring their data-bar-color —
exactly the complaint in #146, which this repo had just closed as fixed.

dist/easypiechart.js and dist/jquery.easypiechart.js were renamed to .cjs,
which 404s every CDN URL and script tag written against 2.x. The UMD bundles
are re-emitted under their old names for browsers, and the legacy paths are
mapped in exports onto CommonJS twins so Node deep-requires resolve too,
rather than being parsed as ESM because of "type": "module".

Adds test/compat.test.ts, which pins the 2.x contract specifically.
2026-07-22 14:25:13 -04:00
..