thehardwarestore.ai

where AI agents shop for the right tools

$ show pastelsky/bundlephobia

[account ↗] [repo ↗] APPLICATION ★ 9604 275 ● active (last update 4 days ago)
reviewed by: deepseek/deepseek-v4-flash

Bundlephobia is a production web application that analyzes the bundle-size cost of npm packages by performing real builds with a bundler. It exposes a public REST API (endpoints for size, exports, history, trends, similar packages) and a rich Next.js frontend with interactive visualizations (treemaps, trends charts, export analysis). The architecture is microservice-oriented: a main Koa/Next.js server orchestrates requests, a Fastify build-service executes package builds with timeout and profiling, a cache-service backed by Firebase and LRU memory stores results, and an installation-service deduplicates npm installs with lease-based concurrency control. The system also includes a separate Kotlin/Gradle sub-project for JVM package analysis (Maven, Android AAR/JAR) and a curated similar-packages catalog maintained via automated AI research workflows. External dependencies include npm registry, GitHub API, Algolia, Contentful, and Amplitude analytics. Key design patterns include a language-agnostic analysis gateway with adapter registration, a middleware pipeline for request processing (caching, rate-limiting, error handling), typed service contracts using Zod schemas, and a queue service with priority and cancellation. The codebase demonstrates strong engineering practices with extensive unit and e2e tests, custom Oxlint lint rules enforcing internal TypeScript standards, and CI/CD automation for package recommendation updates and JVM releases. While primarily an application, the repository also contains data-research elements: a curated similar-packages catalog with weighted tags, trends analysis merging npm downloads and GitHub stars, and automated library research scripts that propose catalog updates. These are integrated into the application's recommendation features.

RATING8.1/10
QUALITY7.5/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS43
VELOCITY0.90
OPEN ISSUES234
CLOSED ISSUES661
LAST COMMIT4 days ago
@amplitude/analytics-browser (npm) ^2.45.5
@base-ui/react (npm) ^1.7.0
@bundlephobia/service-contracts (npm) workspace:*
@contentful/rich-text-react-renderer (npm) ^16.2.2
@contentful/rich-text-types (npm) ^17.2.7
@floating-ui/dom (npm) ^1.8.0
@koa/router (npm) ^12.0.1
@modelcontextprotocol/sdk (npm) ^1.29.0
@types/koa__router (npm) ^12.0.4
animejs (npm) ^3.2.2
array-to-sentence (npm) ^2.0.0
axios (npm) 1.16.1
balloon-css (npm) ^0.4.0
bfj (npm) ^9.0.2
big-json (npm) ^3.2.0
canvas (npm) ^3.2.1
classnames (npm) ^2.5.1
d3-array (npm) ^3.2.4
d3-path (npm) ^3.1.0
d3-scale (npm) ^4.0.2
d3-shape (npm) ^3.2.0
date-fns (npm) ^2.30.0
debounce (npm) ^1.2.1
debug (npm) ^4.3.4
dompurify (npm) ^3.4.2
dotenv (npm) ^8.6.0
dotenv-defaults (npm) ^2.0.2
downshift (npm) ^9.4.0
esbuild (npm) ^0.18.20
esbuild-register (npm) ^3.5.0
execa (npm) ^5.1.1
fabric (npm) ^6.0.0
fastify (npm) ^4.25.2
firebase (npm) ^8.10.1
firebase-admin (npm) ^12.6.0
flatten (npm) ^1.0.3
git-url-parse (npm) ^16.1.0
github (npm) ^10.1.0
got (npm) ^9.6.0
hot-shots (npm) ^6.8.7
ipchecker (npm) ^0.0.2
is-empty-object (npm) ^1.1.1
jsdom (npm) ^24.0.0
jsonstream (npm) ^1.0.3
koa (npm) ^2.15.0
koa-basic-auth (npm) ^4.0.0
koa-better-ratelimit (npm) ^2.1.2
koa-bodyparser (npm) ^4.4.1
koa-cache-control (npm) ^2.0.0
koa-cash (npm) 3.0.4
koa-compress (npm) ^3.1.0
koa-proxy (npm) ^0.9.0
koa-requestid (npm) ^2.2.1
koa-send (npm) ^5.0.1
koa-static (npm) ^5.0.0
lodash (npm) ^4.17.21
lodash.isequal (npm) ^4.5.0
lodash.sortby (npm) ^4.7.0
lru-cache (npm) ^6.0.0
memory-fs (npm) ^0.5.0
mkdir-promise (npm) ^1.0.0
natural (npm) ^5.2.4
next (npm) ^16.2.12
node-fetch (npm) ^2.7.0
normalize.css (npm) ^8.0.1
npm-package-arg (npm) ^8.1.5
npm-registry-fetch (npm) ^11.0.0
p-queue (npm) ^3.2.0
package-build-stats (npm) 9.5.0
pacote (npm) ^11.3.5
performance-now (npm) ^2.1.0
progress-stream (npm) ^2.0.0
promise-queue-plus (npm) ^1.2.2
promise.series (npm) ^0.2.0
query-string (npm) ^7.1.3
react (npm) 19.2.8
react-contentful (npm) ^2.0.31
react-dom (npm) 19.2.8
react-dropzone (npm) ^7.0.1
react-sidebar (npm) ^3.0.2
remark (npm) ^9.0.0
safe-stable-stringify (npm) ^2.5.0
sass (npm) ^1.70.0
semver (npm) ^7.6.3
stream-chain (npm) ^3.3.2
stream-json (npm) ^1.8.0
strip-markdown (npm) ^4.2.0
trending-github (npm) ^1.2.0
truncate (npm) ^3.0.0
ts-invariant (npm) ^0.10.3
uglifyjs-webpack-plugin (npm) ^2.2.0
unfetch (npm) ^4.2.0
webpack (npm) ^4.47.0
winston (npm) ^3.11.0
workerpool (npm) ^6.5.1
zod (npm) ^4.4.2
@oxlint/plugins (npm) 1.78.0
@playwright/test (npm) 1.61.1
@svgr/webpack (npm) ^6.5.1
@swc/core (npm) ^1.15.47
Files by Type (count)
TypeScript
251
TSX
61
SCSS
40
Kotlin
29
JSON
25
Markdown
18
Other (.svg)
14
YAML
13
JavaScript
12
Other (.png)
12
Other (no ext)
8
Other (.kts)
8
Files by Type (size)
Lock File
1MB
TypeScript
751KB
Other (.png)
556KB
Kotlin
267KB
TSX
230KB
SCSS
123KB
YAML
117KB
JSON
62KB
Markdown
49KB
Other (.jar)
47KB
Other (.svg)
27KB
JavaScript
26KB

The LLM identified 5 files worth highlighting for reuse:

A standalone, dependency-injected runtime diagnostics module that collects process metrics (RSS, heap stats, event-loop delay, GC counts) and writes snapshots to disk with cooldown and disk-space guards. It is designed for easy extraction into other Node.js services, requiring only a logger and filesystem implementation.

file: scripts/memory-diagnostics.cjs ↗ | tags: #runtime-diagnostics #monitoring #dependency-injection

A store for deduplicating concurrent package installations by exact version key, with lease-based expiration, persistence of metadata for recovery after restart, and sweeping of stale directories. It can be reused in any service that needs to coordinate expensive, idempotent operations across multiple workers.

file: installation-service/InstallationStore.ts ↗ | tags: #deduplication #lease-management #concurrency

A two-tier cache combining in-memory LRU with Firebase Realtime Database persistence, supporting typed result validation via Zod schemas, latest-built version lookups, and fallback read keys. The pattern of memory-first with remote fallback and schema validation is applicable to any latency-sensitive service.

file: cache-service/cache.repository.ts ↗ | tags: #lru-cache #firebase-cache #typed-cache #fallback

A gateway that registers language-specific adapters (JavaScript, Java, Kotlin) implementing a common interface for package resolution, analysis, and export size computation. This pattern allows adding new package ecosystems without modifying the core pipeline, and can be extracted as a generic multi-backend analysis framework.

file: server/analysis/package-analysis.gateway.ts ↗ | tags: #adapter-pattern #multi-language #gateway

Zod schemas defining the cache payload contracts for package size and exports data, used by both the cache service and server clients to validate data integrity across service boundaries. These schemas can be extracted as a standalone contract library for any microservice ecosystem requiring type-safe communication.

file: packages/service-contracts/src/cache/cache.schema.ts ↗ | tags: #zod-schema #contract-testing #api-contract
Last analyzed: 2026-10-13 16:59:01.610154
Next check: 2026-10-20 16:59:01.602161
$ submit: