DefinitelyTyped TypeScript definitions now on NuGet

February 23rd, 2013

I recently started playing with TypeScript on an asp.net MVC web application.

We’re leveraging some third party js libraries and found the type definition files over at DefinitelyTyped a huge help when dealing with libraries not originally written in TypeScript.

The first thing I tried to do was add them via NuGet and when I didn’t see them up there, I strolled to the DefinitelyTyped issues list and saw an open GitHub issue requesting the functionality.

So I took on the task. Created a PowerShell script to automate publishing and synchronize changes to the DefinitelyTyped repo up to NuGet.

This morning I pulled the trigger and published 127 different NuGet packages for each DefinitelyTyped TypeScript definitions.

As an example:

If you ran this in visual studio NuGet Package Manager console

Install-Package angularjs.TypeScript.DefinitelyTyped

You would get the following installed into your project

image

Note how we didn’t ask it to install jQuery? The powershell script leverages the reference path:

/// <reference path="../jquery/jquery.d.ts" />

in each TypeScript definition to help determine dependencies. We then configure the NuGet package with a dependency on the jquery DefinitelyTyped TypeScript definition package.

image

 

Happy TypeScripting!

  • http://twitter.com/stevewillcock Steve Willcock

    Wow, great job, I was half expecting a single package for all type definitions, but this is much better, thanks for taking the time to do this :)

  • http://twitter.com/pol84_ Pawe?

    Nice one! Thanks!

  • lerma

    This is what I am looking for. Thanks for creating this article bro. http://www.racksandups.com.au