Wanderer Refactor 2.0: Typescript Edition
Two years after the previous one (and not a lot of actual website updates in the meantime), I’ve refactored wanderer once again, this time rewriting the whole thing in Typescript.
I also moved the repository, because I split up my Github to distinguish between work and personal projects, and so now wanderer can be found at https://github.com/a-morphous/wanderer.
Besides that, the major changes were:
- Using
pnpm
instead ofnpm
for the package manager, allowing me to use workspaces and thus actually separate out my package.jsons without needing a custom script for them - Using
marked
as a markdown parser instead of my own;marked
doesn’t have any dependencies of its own, so felt okay to use. This also has the side effect of auto-hyperlinking some of the links that I hadn’t linked before, and changing some of the markdown that had not been handled, so some parts of the site might look a bit weird in the meantime. - Using
jsonata
(https://jsonata.org/) as the query language for producing logs and feeds, rather thantaffydb
.taffydb
had not been maintained for many years, andjsonata
worked directly on the JSON instead of requiring me to create another database, so worked nicely. I don’t anticipate any of my sites becoming so big that I’d need the performance of a full database.
Aside from those swaps, most of the code changes were from the refactor, and from trying to standardize the ways that wanderer was transforming the files. Part of the reason why I had so much trouble maintaining wanderer was because different file types were represented internally as very different objects, which meant that plugins would have to deal with many special cases to work on a complete site. Now, it feels a lot better, now that I have types for those objects and clearer rules on how they are created…but who knows, in half a year I might still forget everything and not know how to update wanderer. But either way, I’ve already gained some benefit from rewriting wanderer, because I finally wrote an rss plugin, and should have that ready shortly to finally give this site an rss feed.
As of right now, the site has been rebuilt, and hopefully nothing has broken.