The repository for high quality TypeScript type definitions
website | definitelytyped.or |
organisation | DefinitelyTyped |
repository | borisyankov/DefinitelyTyped |
DefinitelyTyped is a repository on Github where people share and maintain TypeScript type definitions for existing JavaScript libraries so they can get the benefit of compile-time static type checking. Currently there are close to 500 libraries modelled, and a few more land every day whenever a user creates one and shares it with the community.
It is an interesting project with many aspects so I'd outline the important parts. I can easily fill many pages describing what is going on. Because I generate text easily there are blobs of text from me about DefinitelyTyped all over the internet, like on reddit, hackernews, codeplex and of course the github issue tracker.
We have a team of 11 people (and one bot) from all over the planet, where most are active in reviewing and merging the constant stream of pull requests. The contributions to the repository are a big community effort, with about 1400 forks (!) and 2200 stars. I joined this project when I adopted TSD, the previous author was one of the two repo owners of DefinitelyTyped and we decided to move TSD into the DefinitelyTyped Github organisation.
DefinitelyTyped is now the go-to source for JavaScript type information. Even some non-TypeScript projects are pulling our info, like various JavaScript enhancing libraries, and the IntelliJ IDE's have a feed embedded. We are even linked from various official TypeScript websites and got recognition on the latest Microsoft Build conference, in two of the most important TypeScript presentations and various interviews.
At this point I am most active in infra-structure work and moving the organisation forward. And of course every once in a while I do my bit in merging open definitions and fielding questions from our users. This takes a lot of time but it pays back in a lot of experience in assessing JavaScript API's and their type representation.
I'm one of the more vocal collaborators with the ideas so I also get involved with meta questions and future plans. Also I battle the noisy users: there is this phenomenon that every few weeks/months someone turns up with visions and crazy ideas, and I'd love to engage them. Some have good ideas too, some less so. But you got to be polite and accommodating when hosting a community so it a good for experience.
My main contribution is of course the package manager, TSD, as described on it own page.
I also improved the testing tool that runs on Travis-CI. It validates the types by running the TypeScript compiler (in node.js) on the definitions and their test/demo file. This used to run naïve in serial, and at 400 definitions it took over an hour to complete, until one day Travis started timing-out. I reworked the test-runner to run parallel on multiple cores, as Trarvis runs on massive 32 core hardware we hog 24 cores to finish the build under ten minutes.
Then I went further and added a Git-diff script that checks what files are actually changed in a pull request (or merge), then resolves references and dependencies. This means most builds only need to run a few tests and finish in under a minute. Except if anything touches JQuery, so many libraries relate to it a changes creates a huge reference cascade that touches half the repos, but at 24 cores even that is done pretty quickly.
There is a fair set up palns in the pipeline, sadly nobody has time to make it happen. But slowly we get there.
I felt a need for a fancy DefinitelyTyped website, after some proposals I went ahead and did a crash-course docpad (static site generator) and hammered out a site in semantic-ui. It lives at definitelytyped.org.
At this point it looks real enough the other org members are starting to get interested so we're expanding content and adding more pages.
Because I'm not a natural designer I depend on the framework, but it was easy to get something good looking out there: with plenty of white-space and a good font you can go a long way.
Docpad is a static site generator so I've also set it up to be re-build via Travis-CI, and use a bot-account to push the build to github-pages.
Everyone likes some bling on his projects so I moved to start providing readme-badges. This is an ongoing sub-project as our github.io hosting doesn't support https, but we're working on getting a sponsor for a CDN service.
I'm looking into adding some webhooks and a node.js webservice to automate features and go for the next level. Using some modules from npm this is technically easy but we're not sure off the problems we try to solve, let alone the solution we need. But we have the technology, it will be build in the next months. On the shortlist is a Gitter integration, should be easy enough.
One of my favourite ways to procrastinate is writing new type definitions. I wrote some for bluebird, highland, parsimmon, joi, lazy.js and a whole bunch of smaller modules. It is an interesting way to kill some time because your learn a lot about the package your are modelling and it is more of a craft then a science. And the actual implementation is not trivial either: it takes some experience to get fast at it.
Recently I imported ~30 definitions from an existing repository that wanted to merge with DefinitelyTyped. It had like 60 definitions, with a lot of overlap. Other people didn't look forward to the slog but I attacked it with a fat google-spreadsheet and moved all the good parts over to our repository. The pull request was pretty epic.
Plenty of small side projects. For example I drive the vision and feedback on a yeoman generator a collaborator is building, it will generate boilerplate for the definitions.
And I scout for people and projects who can make a JavaScript analyser that can generate typings from Javascript or JSDocs. Meanwhile I try to get the organisation to step up their game, for example by supporting BountySource, writing guides for the site and do many other enhancements.