Skip to main content

Dependencies

Rendered from corpus/wiki/dependencies.md · updated 2026-11-06

This page is generated from the project corpus and rewritten on every docs build. Edit the source in corpus/, not here.

Per-workspace. Versions are locked in package-lock.json.

core/ — @newspapper/core​

PackageWhy
better-sqlite3Synchronous SQLite for posts, sources, articles, feed items, settings.
dotenvLoads .env at startup.
fflatePure-JS zip for zipRun() (no native binary needed).
playwrightHeadless Chromium for 1080×1080 slide screenshots.
rss-parserRSS/Atom feed parsing (normalized items, zero-config).
sharpImage normalization for uploads (auto-orient, downscale to 2160px, strip EXIF) and the optimization pass on publish. Pinned to 0.35.4. Added 2026-08-27, when the v2-era ban was lifted — that rule existed because the project had no images to process, and images are now a first-class component. The rest of the forbidden list (canvas, cheerio, Handlebars, inquirer, ora, axios, Satori) still stands.

api/ — @newspapper/api​

PackageWhy
fastifyHTTP server with schema-based request handling and plugin system. 5.12.5 since 2026-10-02, clearing its own advisories and, transitively, find-my-way and fast-uri.
@fastify/corsCORS for dev-server proxy requests from port 4321 (the Vite dev server; Astro's until 2026-08-31).
@fastify/staticServes /assets/fonts/, /output/, and ui/dist/ in prod. Not used for /uploads/ — that route resolves refs through the DB and streams the file itself. 10.x since 2026-10-02: 8.3.0 carried a static-plugin guard-bypass advisory class; the 8 → 10 major changed nothing newspapper relies on.
@fastify/multipartParses the single-file POST /api/uploads body, with a streaming 10 MB fileSize limit so an oversized upload is cut off rather than buffered.
@newspapper/coreAll pipeline logic.
vendor/ward/ (not an npm package)The shared auth library, version 0.2.0, copied in whole (server bundle, types, README, LICENSE) and never edited; it needs no install and imports only node: built-ins. Upgrade by vendoring a newer build over it. It replaced the hand-written Ward client and its jose dependency (removed 2026-10-13, which was also the one unpinned version in the repo).

ui/ — @newspapper/ui​

PackageWhy
viteBuild tool and dev server (dev deps, with @vitejs/plugin-react). Replaced Astro in the move to Vite + React (2026-08-31) — every page was client:load behind auth, so nothing Astro offered was in use; why.
vendor/ward/ (not an npm package)The same library's React bundle: the unstyled hooks behind the login page, the tray's session cell and Settings. The copy also holds the server bundle, which the UI never imports; both copies must stay the same version.
react, react-domThe whole UI. Routing is ~95 hand-rolled lines in ui/src/router.tsx over useSyncExternalStore; no router dependency — see the decision above.
@base-ui/reactHeadless, accessible primitives behind the shared components/ui/ library (Button, Input, Select, Toggle/Switch, Modal/Dialog, Toast). Styling-agnostic — styled with warm-industrial CSS-variable tokens.
@newspapper/coreTypes, plus the browser-safe ./wizard subpath — the editor parses, lints and compiles with the same code the renderer uses. No Node APIs.
@use-gesture/reactPointer gestures in the editor: the split-screen divider drag and slide reordering. Replaced a half-built HTML5 drag-and-drop; pointer events give one code path for mouse, touch and pen, and drag-and-drop cannot express a resize handle at all.
animejs4.5.0, installed by the chrome build (2026-08-31). Drives the two authored motion moments — the compile and the tissue hinge — and nothing else; the canvas never animates. MIT, no dependencies, framework-agnostic. Chosen over motion-primitives and smoothui, which require Tailwind CSS; why.
dompurify3.4.16, added by the Reader work (2026-10-09). Sanitizes a Reader item's feed HTML in the browser, at render, against an allowlist (ui/src/components/reader/sanitize.ts); the app sets no CSP, so it is the only line of defence. Not sanitize-html on the server: DOMPurify parses with the browser's own parser, the one that then renders the result, so nothing can parse one way when cleaned and another when shown (sanitize-html uses htmlparser2); the stored HTML stays as the feed sent it, so the allowlist can change without rewriting rows; and the API stays free of an HTML dependency. When DOMPurify.isSupported is false it hands its input back untouched, so the Reader then shows content_text instead. Its test runs in real Chromium, not happy-dom: see the next row.
happy-dom (dev)A DOM for the few UI tests that must really mount: an error boundary only works in a live render (ErrorBoundary.test.tsx, 2026-10-03), and the Reader's keys, routes and item body (2026-10-09). Opted into per file with // @vitest-environment happy-dom; every other test runs in node. DOMPurify does not work under it although isSupported is true (why), so a test that renders an item stubs the sanitizer.

Root dev deps​

PackageWhy
typescriptSource language for all three workspaces, and since 2026-11-04 the compiler that builds core and api into the dist/ production runs.
tsxDev runner: tsx watch for the API and npm run seed. Not in the runtime image since 2026-11-04, which installs production dependencies only and runs the compiled API under node (why).
vitestTest framework (co-located *.test.ts).
concurrentlyRuns API + UI dev servers in parallel (npm run dev).
eslint, prettierLint and format — both enforced: npm run build runs fmt:check first, and npm run lint covers all three workspaces. Until the tooling fix (2026-08-31) there was no Prettier config at all and eslint.config.js enabled zero rules; why the current shape.
@eslint/jsThe recommended JS ruleset. Was a transitive dependency; declared explicitly by the tooling fix (2026-08-31) when the config started importing it.
eslint-plugin-react-hooksHook correctness in ui/. rules-of-hooks and exhaustive-deps are on and clean; the React Compiler rules (set-state-in-effect, refs) are errors since the hook-rules fix of 2026-08-31.
@types/node, @types/react, @types/better-sqlite3, @types/react-domType declarations.

docs/ — @newspapper/docs-site​

The docs site, built by npm run docs --workspace=docs and never imported by the app. Docusaurus 3.10 (@docusaurus/core, preset-classic, faster) with @easyops-cn/docusaurus-search-local for offline search, typedoc for the @newspapper/core reference, and the two @fontsource faces for The Mechanical. Pinned exactly, like everything else. It replaced Astro Starlight on 2026-10-19; astro, @astrojs/starlight, sharp and cookie left with it (core and api declare their own sharp).

cheerio arrives here transitively, through @docusaurus/plugin-content-blog (part of preset-classic, even with the blog off) and the search plugin. The owner allowed that on 2026-10-19, for the docs workspace only: the forbidden list above is the app's rule, and core, api and ui still may not depend on cheerio. npm ls cheerio shows both paths, and both run through @newspapper/docs-site.

What changed from v2​

RemovedAddedReason
satoriplaywrightChromium rendering replaces SVG-based Satori
@resvg/resvg-jsfflatePNG-from-SVG gone; pure-JS zip instead of native binding
cacfastifyCLI gone; HTTP server instead
react (render)@fastify/cors, @fastify/staticNo JSX rendering needed
handlebars—Compose prompt is a plain string
openai, axios—LLM calls were Ollama-only at the time, and are gone entirely since the Wizard pivot; HTTP is Node's own: fetch, and node:http/node:https for the scrape requests since 2026-11-06 (why)

Native build requirements​

  • better-sqlite3 — C++ toolchain needed on source build; prebuilt binaries ship for common platforms.
  • playwright — downloads Chromium on npx playwright install chromium; no toolchain needed at install time.
  • sharp — prebuilt libvips binaries ship per platform (@img/sharp-*); no toolchain needed on the supported ones.

No Python. No system libraries beyond libc.