TSD

npm tsd
github DefinitelyTyped/tsd
www www.tsdpm.com
video channel9.msdn.com (around ~22:52)
screenshot help.png
async.png
angular.png

TSD is a package manager to search and install TypeScript type definition files directly from the community driven DefinitelyTyped repository.

It is used mostly as a CLI tool, similar to npm or bower. The content is pulled from the Github API, with a lot of (http-)caching. Internally it is mostly Promise/A and a little streaming code.

This is my main project; my significant contribution to the community. My baby, nasty and horrible on the inside, beautiful and amazing on the outside.

Project

The first version was my first big project in TypeScript, and also my biggest project on npm. Current release version has a fair amount of users for something as niche as this; it has Google Analytics integrated and that shows a steady 100-200 significant actions per day, with peaks around 300. On npm I see daily install rate of about 50-100. It is not quite bower-level but then many TypeScript definitions are installed via NuGet or pulled directly from the repository.

I adopted this project from the previous owner who lacked time to take it further. His last version used a huge manually updated JSON file and was very much C#-inspired, heavy OO style. I rewrote it on the Github API in what looks like my old ActionScript 3 code pattern. By talking to Github directly it is always up-2-date.

It has support for OAuth to boost the rate-limit, proxy support and some other hardening. The http-layer uses cache headers and gzip, and is stored on disk by hashing the significant http parameters (url, headers etc).

Site

The previous version had its own website with a simple search feature. So after my re-release I did a crash-course Twitter-bootstrap and Vue.js and hacked a simple site in a few evenings. It uses Oboe to stream a big JSON and fill a big table with simple search field.

At this point the JSON is semi-manually updated using a grunt task. It could be automated now, but that might happen together with a future DefinitelyTyped update (infrastructure thing, ask me about it).

This is queued for a redesign: the DefinitelyTyped organisation recently was joined by a real designer, so I've left it as is, with my cyber-cyan color scheme and funky CSS glitches.

Future

After a year of using npm and reading blogs I now see the TSD architecture is less then ideal: it is a big fat monolith and file-IO is all over the place (with some sync too). I've picked up on the notions op "the node way" and streams and that will be the way forward.

We need that modular code for other DefinitelyTyped projects and I want the whole thing to be browserifiable so people can embed it in online code editors.

Overall I'm still pretty happy with it even though I now disfavor the general architecture I'd still stand for the choices made, most of all because it works as intended and solves a real problem.

And there are enough users to make it a real thing and send interesting bug reports (I love my Japanese power-users :)

Recognize

It was mentioned in a very widely viewed video on Microsoft's Build 2014 conference: http://channel9.msdn.com/Events/Build/2014/3-583 (around ~22:52), with a big spike in the npm stats afterwards.