engineeringNovember 5, 2026 · 4 min read

I finally shipped the side project I abandoned in 2022

Four years ago I started a TypeScript wrapper for the Rebrickable LEGO API and never finished it. This month I revived it, rewrote most of it, and published it to npm.

In September 2022, I started a TypeScript wrapper for the Rebrickable API. Like any sensible and absolutely necessary side project, it had a need and a want. I wanted to search for and track the LEGO sets I owned, and the software engineer living inside me needed the correct API type declarations.

I got the Sets endpoints working, wrote a few tests, and then stopped. The project sat untouched for four years.

This month I came back to it, and last week I published rebrickable-client to npm.

What I found when I came back

Opening a four-year-old codebase is a particular kind of experience. The code mostly made sense, which was reassuring. The state of the tooling was not reassuring at all.

Running yarn audit against the 2022 dependencies returned 457 vulnerabilities. Twenty-nine were in packages that actually shipped with the library. One was critical. The main HTTP dependency, axios, was pinned to an old version because a caching adapter I’d included required it, and the caching adapter itself had been abandoned by its maintainer. The whole dependency tree was in a state I wouldn’t have been comfortable publishing.

The test suite was in a similar condition. Eight tests were passing, but on closer inspection, seven of them were testing a URL builder I had written from scratch rather than anything that touched the actual API. The real API tests were all commented out.

Just before I made the repository public, a history scan turned up a live API key committed in 2022 and never properly removed, only replaced with a placeholder in a later commit. The key was still active. I regenerated it before anything went public.

So pretty standard for an abandoned project, and a useful reminder about maintaining dependencies.

What the revival looked like

Rather than patch what was there, I treated it as a proper rebuild using the old code as a reference. The approach that worked was small, sequential pull requests, one concern at a time.

The first PR replaced the entire HTTP layer. Axios and its dependencies were gone, replaced with native fetch, which has been available in Node without any flags since Node 18. That one change dropped the runtime dependency count from four to zero and cleared every shipped vulnerability. The published package is now 18 kB and needs nothing except the runtime.

From there, each of the seven API resources got its own PR: colours, themes, part categories, elements, parts, minifigs, and sets. Working through them one at a time meant each change was small enough to review properly, and problems in one resource didn’t block others.

The test count went from 8 to 104, backed by 27 real API responses captured as fixtures. The source grew from 494 lines to 1,134. Thirteen pull requests in under two weeks of part-time sessions.

A few things worth highlighting

Zero runtime dependencies.

This was a deliberate goal from the start of the rebuild. A library that needs nothing extra to run is easier to trust, easier to audit, and works in more environments. Rebrickable-client runs in browsers, Node, Deno and Bun.

Rate limiting built in.

Rebrickable allows roughly one request per second and will ban IPs that ignore 429 responses. Rather than leaving that problem to the caller, the client handles it internally. Concurrent requests queue themselves, and on a 429, the client waits exactly as long as Rebrickable asks before retrying.

Async iteration for pagination.

The API is paginated. Rather than exposing that as a detail the caller has to manage, every resource has a listAll method that returns an async generator. You iterate over results with for… await, and pages are fetched lazily as you go. A break stops fetching immediately. Listing all 25,000-odd LEGO sets takes about 25 requests instead of 250, because the page size defaults to the API maximum.

import { Rebrickable } from 'rebrickable-client';

const rebrickable = new Rebrickable({ apiKey: 'your-api-key' });

for await (const set of rebrickable.sets.listAll()) {
  console.log(set.set_num, set.name);
}

The AI collaboration

Most of the execution work was done in Claude Code sessions, directe and reviewed at each step. I want to be straightforward about what that looked like in practice, because “I used AI to build this” can mean a lot of things.

The agent did not design the project. Every significant decision - what to replace, what to keep, how to structure the resources, how to handle rate limiting - came out of a planning conversation before any code was written. The rule I settled on early was: no code changes until I’d accepted a written plan for that step. That discipline made the whole thing more coherent than most of my unassisted (and unfinished) side projects, which tend to accumulate small inconsistent decisions over time.

The agent also did not touch the outward-facing actions. I committed the code, opened and merged every PR, ran npm publish, made the repository public, and regenerated the API key. The parts where a mistake has real consequences stayed with me.

Where the agent was genuinely useful was the grunt work: writing the resource classes once the pattern was established, generating fixture capture scripts, writing tests, catching inconsistencies between resources. Work that is important but repetitive once the design is settled. That freed my attention for the decisions that actually required judgment.

Where can you find it?

Rebrickable-client is on npm. It covers the full public LEGO catalogue: sets, parts, minifigs, colours, themes, part categories, and elements. The repository is public at github.com/kevanstuart/rebrickable-ts.

npm install rebrickable-client

Last words

The one thing it does not yet cover is the user endpoints, the part of the API that lets you manage a personal collection. That requires write requests and an authentication flow that is meaningfully more complex than the catalogue endpoints. It is the obvious next step, just not one I had time for in this round.

The side project graveyard is a real place. Most things that go in do not come out. This one did, and it works, and it is shipped. That feels like enough for now.

← All writing