refactor(core): replace cheerio with linkedom to drop deprecated whatwg-encoding (#187)

## Summary

- `cheerio` pulls `encoding-sniffer` → `whatwg-encoding@3.1.1` (deprecated), causing a warning on every `npm install -g hyperframes`
- `linkedom` was already bundled into the CLI via tsup `noExternal` and has zero deprecated transitive deps
- Rewrote `htmlBundler.ts` and `subComposition.ts` to use standard DOM APIs via `linkedom`
- Added a `parseHTMLContent` helper that wraps HTML fragments in a full document structure (required for `linkedom` to populate `document.body`)
- Removed `cheerio` from `cli` dependencies and tsup `external` list
- Replaced `cheerio` with `linkedom` in `core` `optionalDependencies`

## Test plan

- [x] All 411 tests pass (`bun run test` in `packages/core`)
- [x] Full monorepo build succeeds (`bun run build`)
- [x] TypeScript typecheck passes
This commit is contained in:
Miguel Ángel
2026-04-03 16:06:30 +02:00
committed by GitHub
parent 06e3da9ad3
commit e2c8ed5d83
9 changed files with 226 additions and 210 deletions
+2 -2
View File
@@ -109,7 +109,7 @@
}
},
"optionalDependencies": {
"cheerio": "^1.2.0",
"esbuild": "^0.25.12"
"esbuild": "^0.25.12",
"linkedom": "^0.18.12"
}
}