TypeScript (4 blogmarks)
← BlogmarksFactorioLab
https://factoriolab.github.io/a tool for calculating resource and factory requirements for factory games
The main link is to the online calculator itself. That pull quote is from the factoriolab GitHub repo (a TypeScript project).
I assumed this was just a calculator for Factorio, but I guess there are a bunch of factory genre games that benefit from a calculator app like this, e.g. Dyson Sphere Program.
Playing Sudoku in TypeScript while the type checker highlights mistakes
https://github.com/gruhn/typescript-sudokuIt's always fascinating to see the over-the-top ways people (ab)use the TypeScript type checker to do things it was never meant to do.
This is an experiment to precisely define a Sudoku type. The goal is that we can play Sudoku in TypeScript while the type checker complains about mistakes. This is not about implementing a Sudoku solver. Just about writing unnecessarily complicated type definitions.
Introducing Zod 4 beta
https://v4.zod.dev/v4Several years in the making, Zod 4 is now in beta with a ton of performance improvements, bundle size improvements, and some new features.
Zod 4 is now in beta after over a year of active development. It's faster, slimmer, more tsc-efficient, and implements some long-requested features.
The things that caught my attention were:
- JSON Schema conversion -- this makes a schema serializable and portable to other contexts and even languages.
- Error Pretty Printing -- this is huge for dev server logs and scripting output because the errors are way more readable and don't completely blowout the terminal scroll back buffer.
- StringBool -- this seems nice for CLIs or JSON parsing where you know you're in a certain domain with specific truthy and falsy values
- Refinements and Overwrites -- the under-the-hood changes that allow refinements to be mixed in with other schema methods. Overwrites allow for same-type transformations that work with JSON schema conversion.
One of the headline features is Metadata and Schema Registeries which looks cool, but I can't see how I'd use it for anything I've done with Zod up to now. The best I can tell is that a library like OpenAPI or a form library would use it to essentially annotate a schema with additional metadata.
I've only mentioned a handful of the features, but the whole post is worth digging into. Matt Pocock also did an overview in Zod 4 is out, and it is CRAZY on his Youtube Channel.
Build complex CLIs with type safety and no dependencies
https://bloomberg.github.io/stricli/I heard about this from Matt Pocock who says he is moving a tool he is building from Commander to StriCli.