1

I am using bower to manage my third-party JavaScript library dependencies for a project. For example, I am using AngularJS, thus I've had to add a dependency on this in bower.json.

I am writing my library in TypeScript. Therefore, it is necessary to have access to the typescript definitions too. Thus, I find myself having to use the tsd package manager.

This means that the same dependency on AngularJS has to be duplicated in tsd.json too.

This is becoming hard to manage as the number of third-party dependencies grows. It is particularly challenging to ensure that the exact same version of the dependencies are imported in bower and tsd, to ensure the TypeScript definitions accurately match the JavaScript files.

I'm finding this really hard to scale on a hobby project. I am assuming there's a neater solution to sovle this on an enterprise-grade project?

jwa
  • 3,239
  • 2
  • 23
  • 54

1 Answers1

1

It is particularly challenging to ensure that the exact same version of the dependencies are imported in bower and tsd

With TypeScript you generally want to use the latest version of the library. This is because DefinitelyTyped is community supported and people that work on OSS generally work with the latest library definitions (no one wants to spend their spare time on an out of date library).

I'm finding this really hard to scale on a hobby project. I am assuming there's a neater solution to sovle this on an enterprise-grade project?

Like I said ... just use n version of the library with latest definition of TypeScript and you will mostly be better off then just using javascript.

basarat
  • 261,912
  • 58
  • 460
  • 511