libhtcpcp

libhtcpcp

1 devlog
9h 10m
Created by Austin

A TypeScript library for coffee pots and teapots!

Repository

Timeline

2025-08-17 update 1:

i decided working on this a while ago and didn't have the thought of submitting it for SoM, but i guess here we are! a few things i've learned so far:

  • generics and conditional types are hard. there's already an npm package for htcpcp, but it doesn't use ESM or have types or minification or any of the modern nice gooey 2025 tooling. and i want this to be different, so absolutely overkill typescript types it is. i've decided to make it extra hard on myself by allowing a server/machine to be instantiated as exclusive coffee or tea making. and it's going to get harder later down the line to support hypothetical pots that support both coffee and tea.
  • HTCPCP and HTCPCP-TEA are really loosely defined, and i had to put together a quick markdown document to specify the edge cases. because boy oh boy there is some logic to how a request to / should be handled.
  • my coffee pot's gotta support estonian tf
  • i really wanted to use a factory function to make the interface (because new is cringe and broken and all that), but classes have a few really nice exclusive features like private properties and getters/setters that simply don't exist as ergonomically elsewhere in the language. i could make a wrapper like (...args) => new class {...} but then since i have overloads, and typescript doesn't support inferring constructor overloads, i might as well have a class-based interface.
  • i realized halfway through that i should probably make the library runtime agnostic (yknow... just in case your coffee pot uses AWS lambda :p), but since i've already sunk enough development cost into node, might as well just get a node-exclusive MVP and figure out runtime agnosticism later. though on that note i might just try to make my library compatible with @hono/node-server.
  • i wanted to use pkgroll for zero-config bundling, and vitest for testing so i could do in-source unit testing, but pkgroll doesn't have integration with vitest or replacing with rollup. so now i'm on a side quest to land support for that upstream.

so far, in terms of progress, i'm not really sure how to judge how close i am to an mvp? i think i'm almost at the part where i handle route handling but currently i'm working on dynamic route assigning to pots in a machine.

Update attachment