chore(deps): drop three unmaintained dependencies (unorm, find-root, jsonminify)#7992
Conversation
Remove dependencies whose upstreams are effectively abandoned, replacing
each with a maintained alternative or native API. No behaviour change for
users; reduces the production dependency surface.
- unorm (last publish 2019): replace `UNorm.nfc(s)` in contentcollector
with native `String.prototype.normalize('NFC')`, available in every
supported Node and browser. Also drop it from Minify's LIBRARY_WHITELIST.
- find-root (last publish 2017): inline a ~10-line equivalent in
AbsolutePaths.findEtherpadRoot(), mirroring find-root's semantics
(closest ancestor containing package.json, throw if none).
- jsonminify (last publish 2021): swap settings parsing to jsonc-parser
(already used by the admin workspace, actively maintained). The old
`jsonminify(str).replace(',]', ']').replace(',}', '}')` had two bugs that
jsonc-parser's allowTrailingComma fixes: String#replace only swapped the
FIRST trailing comma of each kind, and the blind replace corrupted ',]' /
',}' byte sequences inside string values (e.g. URLs).
Added a regression test in settings.ts covering multiple trailing commas
and ',]'/',}' inside string values.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
PR Summary by QodoDrop unmaintained deps (unorm/find-root/jsonminify) with native + jsonc-parser Description
Diagram
High-Level Assessment
Files changed (7)
|
Code Review by Qodo
1.
|
The unorm removal left `$unorm/lib/unorm.js` listed in the ace2_inner.js client bundle manifest. With unorm uninstalled, getTar() would point at a node_modules asset that no longer exists, producing 404s when loading that bundle. Nothing imports unorm anymore (contentcollector now uses native String.prototype.normalize), so the entry is dead and removed. Caught by Qodo review. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
tests/container/loadSettings.js is a standalone helper (separate from node/utils/Settings.ts) that parsed settings.json.docker with jsonminify directly. Removing jsonminify from dependencies broke the container test suite with MODULE_NOT_FOUND. Switch it to jsonc-parser to match Settings.ts. Verified loadSettings() parses settings.json.docker and applies the container ip/port overrides. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
What
Removes three production dependencies whose upstreams are effectively abandoned, replacing each with a maintained alternative or a native API. No user-facing behaviour change — this just shrinks the dependency surface and fixes a couple of latent settings-parser bugs along the way.
This is the low-risk first slice of a broader dependency-staleness audit of core.
unormString.prototype.normalize('NFC')find-rootAbsolutePaths.tsjsonminifyjsonc-parser(already used by theadminworkspace)Details
unorm—contentcollector.tsonly usedUNorm.nfc(s).String.prototype.normalize('NFC')is available in every Node and browser Etherpad supports, so the polyfill is dead weight. Also dropped fromMinify.ts'sLIBRARY_WHITELIST(nothing imports it client-side anymore).find-root— used once, infindEtherpadRoot(). Inlined a small helper with identical semantics (closest ancestor directory containingpackage.json, throws if none found before filesystem root). Verified it resolves to the same repo root.jsonminify— settings parsing wasjsonminify(str).replace(',]', ']').replace(',}', '}'). That had two real bugs thatjsonc-parser(allowTrailingComma: true) fixes:String#replacewith a string needle only swaps the first match, so a settings file with more than one trailing comma of the same kind stayed invalid.,]/,}replace also corrupted those byte sequences inside string values (e.g. a URL containing,]).Error semantics are preserved: a malformed/empty settings file still logs and
process.exit(1)s.Tests
tests/backend/specs/settings.tscovering multiple trailing commas and,]/,}sequences inside string values.settings.tsspec: 32 passing.contentcollector.ts+import.tsspecs (full server boot + HTML/DOCX/PDF round-trips, exercise the NFC path): 123 passing.tsc --noEmit: clean.Not in scope
measured-corewas in the original audit shortlist but is descoped — it backs the/statsendpoint'stoJSON()shape (admin cards + a public endpoint depend on it), so swapping it toprom-clientis a behaviour change, not a cleanup. Tracking that, plussecurity/html-to-docx/languages4translatewikiadoption, separately.🤖 Generated with Claude Code