Automatically resolve/insert dependecies to other Typescript Files?

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? A T4 template that generates a global references.ts with all typescript files referenced does not work for me because i need to compile with --out and avoid all unnessecary code.

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?

This may be too simplistic for you, but there is a common pattern used by TypeScript programmers to make this easier.

You add a file named references.ts to your program that references all of your files - then you only ever need to reference this file elsewhere in your program.

///<reference path="references.ts" />

You could even add the above code to your TypeScript file template (replacing the IPoint sample code).

In your specific scenario, you are saying you want to have the control over the references, which suggests you should add them manually. Did you know you can drag a TypeScript file from solution explorer onto your editor to automatically add the reference comment?