Automatically resolve/insert dependecies to other Typescript Files?

Topics: General
May 15, 2013 at 4:19 PM
I am building a web framework for typescript (hope to push an early preview out soon).
I am in love with a lot of the great things of Typescript. But one thing i find very tedious is adding all the references to other TS files. This must be an automateable task and can safe me a lot of time. Because when starting a new project like my framework lots of things move around quit often, also if i miss to remove a reference it have unnessecary code (--out compilation).

Is there anything available yet? If not my idea was to build a little node.js app that watches all .ts files in a folder (start it via .bat) and then looks into them on every change and adds all needed references and removes all unneeded ones.

Any other thoughts or ideas to that problem?
May 15, 2013 at 4:44 PM
I use a _references.ts file which contains references to all the .ts files in the project, and is referenced from all of them.

I do like the idea of a watcher that maintains that _references.ts file automatically though.

Mark Rendle
Founder & CEO
Oort Corporation
Makers of Zudio


May 15, 2013 at 4:52 PM
Edited May 15, 2013 at 5:53 PM
The problem with a _references.ts that contains everything is that with the --out parameter all code gets bundled into the final javascript file that gets transferred to the client. A lot of waste plus ti can/will contain Node,js code that can not run on the client.
May 15, 2013 at 8:55 PM
What kind of framework are you working on? I am also working on a framework built on top of express. I have a great TypeScript building solution for Node.js platform ready which solves many problems especially for things like frameworks ... Contact me if you are interested, I need testers before publish ...
May 16, 2013 at 11:50 AM
TobiasHei: Then make multiple typescript projects, Shared, Client, Server. Each project has its own References.ts and Client and Server contains reference to Shared project References.ts

This T4 template does generate References.ts file for you (with references to all .ts and .d.ts files in project, and references to other projects Reference.ts files - based on visual studio project references)
http://pastebin.com/mYAFsesG