Skip to content

Reduce dependencies - #1039

Open
paulrobertlloyd wants to merge 13 commits into
mainfrom
reduce-dependencies
Open

paulrobertlloyd wants to merge 13 commits into
mainfrom
reduce-dependencies

Conversation

@paulrobertlloyd

Copy link
Copy Markdown
Collaborator

Removes, replaces or isolates dependencies that every install was paying for, without changing what Indiekit does.

Changes

Development tooling moved out of the workspace

  • VitePress now lives in its own project in docs/, installed only to build the documentation.
  • Lerna is replaced by Lerna-Lite, installed separately in .github/release/ and used only by the publish workflow.
  • The Bluesky syndicator tests use a lightweight mock server, validated against the lexicons in @atproto/api, instead of @atproto/dev-env (a full Bluesky server).
  • Removes the unused eslint-import-resolver-node.

Frontend assets prebuilt

  • @indiekit/frontend bundles its scripts and styles when it’s packed, and serves those files at runtime. esbuild, lightningcss and browser-only packages (easymde, @accessible-components/tag-input, microlighter) are now development dependencies.
  • In a clone of the repository, bundles are still built when the server starts (see docs/development.md).
  • The Docker image prebuilds the bundles in a separate build stage.

Dependencies replaced

  • color: variants of the primary colour are now derived in CSS using relative colour syntax. Only the theme colour’s hue is calculated on the server.
  • iso-639-1: replaced by Intl.DisplayNames.
  • clean-stack: replaced by cleanStack() in @indiekit/error.
  • bcrypt: replaced by bcryptjs, which has no native code and works with existing PASSWORD_SECRET values.

Before and after

Fresh installs on Linux x64 (Node 24, npm 11):

main This branch Change
Lockfile entries 2,103 806 −62%
Development install (npm ci) 1,936 packages, 1,055 MB 792 packages, 379 MB −59% packages, −64% disk
Production install (npm ci --omit=dev) 640 packages, 279 MB 385 packages, 179 MB −40% packages, −36% disk

The docs project (VitePress) and the release tooling (Lerna-Lite) are now installed only when needed.

Changes in behaviour

  • themeColor must be a 3- or 6-digit hex colour, as documented. A missing or invalid value falls back to the default colour, and a warning is logged.
  • Accent colours are now derived in CSS, limited in OKLCH lightness so they keep a contrast ratio of at least 4.5:1. Accents in the dark colour scheme are more strongly coloured than before. Browsers without relative colour syntax use the primary colour unchanged.

Before merging

  • Build the Docker image (it now has two stages).
  • After the next release, confirm @indiekit/frontend on npm includes dist/app.js and dist/app.css, and that the trusted-publishing upload worked with Lerna-Lite.

Install VitePress and its markdown-it plugins from docs/package.json
instead of the root workspace, so contributors and CI jobs that don’t
build the documentation no longer install them.
Validate requests, responses and records against the lexicons bundled
with @atproto/api instead of running a full PDS. Removes @atproto/pds
and the native better-sqlite3 dependency from development installs.
Calculate only the theme colour’s hue on the server and derive variants
using CSS relative colour syntax. Removes the color dependency.
@paulrobertlloyd paulrobertlloyd added the code quality Making things easier to understand label Nov 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality Making things easier to understand

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant