7

Closed

Add option for nesting TypeScript output in project

description

This issue was raised once on WebEssentials (here) already but they told me it's an issue of TypeScript.

When I save a TypeScript file it generates the javascript and map file as it should be. The problem is that the generated files are NOT automatically added to the project file references. This is a big problem since we're using T4MVC which doesn't create links to those files. Another problem is that the web-publish doesn't publish js files since they are unknown (not in project).

Are there any plans to nest the .js and .map files under the .ts files on generation?
Closed Jul 28 at 11:18 PM by jonturner
As part of our move to GitHub, we're closing our CodePlex suggestions and asking that people move them to the GitHub issue tracker for further discussion. Some feature requests may already be active on GitHub, so please make sure to look for an existing issue before filing a new one.

You can find our GitHub issue tracker here:
https://github.com/microsoft/typeScript/issues

comments

nabog wrote May 9 at 5:44 PM

Our experience has been the complete opposite. When TypeScript projects nested the .js output in an earlier version we had a lot of problems with these files ending up in source control.

For the publishing etc. I would consider writing a powershell script that copies the .js files to the necessary folder.

jamesnw wrote May 9 at 6:38 PM

I had this issue also. There's are VS plugins to allow nesting, but it became a pain to work with at times. In the end I just wrote a build event script. If using GIT, it doesn't matter if the .js files are in the project tree or not, they will all be picked up via the file system itself (I had to use .gitignore). If nesting is an issue, it's only with TFS. IMHO TS should have an option to nest .js files for GIT users.

SeriousM wrote May 9 at 8:05 PM

I would welcome an option to choose if it should be nested or not.

There is another problem that devs have to face if they are using azure web service as deployment platform:
The deployment package will ONLY contain files that are referenced in the project file, nothing more, nothing less.

danquirk wrote May 10 at 2:15 AM

We used to do this and had to change it for a few good reasons (source control support comes to mind) but I'm marking this as a suggestion for others to upvote if it's a priority.

SeriousM wrote May 11 at 8:32 AM

Thank you to at least consider adding it.

mhegazy wrote May 18 at 8:03 PM

Btw, this is not a TS issue. This is about how you structure your project file. We do not think this is the best way to organize your TS project for the reasons outlined above. But if you want to do it, just use the dependantupon tags in your project file:
<Content Include="file.js">
 <DependentUpon>file.ts</DependentUpon>
</Content>

SeriousM wrote May 19 at 1:56 PM

Thats why I reported it to the WebEssentials Team because they will deal with the project structure and nest those files. Could please someone talk to them directly? I'm just a guy from outside that likes to get a clarification if this vital feature will be added or not.
Thank you.

jamesnw wrote May 20 at 4:57 AM

Personally, I think making it difficult for people to open the generated .js files by forcing them to enable "view all files" is terrible idea (Web Essentials split screen is just annoying for me). At the very least, I would suggest adding the ability to right-click the .ts file, or edit window, and have the menu command to open the resulting .js file.

SeriousM wrote May 20 at 9:09 AM

To me, type-script is like coffee-script. There is a .ts file and there has to be a .js file which is usable. beside that, there is a .ts.map file as support for the browser.

@mhegazy:
It's not an option for me or my team to add these files as nested manually because it's too error prone and T4MVC won't work anymore (which is very vital for us).

@jamesnw:

1: I don't like the split view either (which can be disabled).

2: Adding the files as nested would be enough. People are used to look at nested files. It works for coffee-script, why not for type-script as well?

I think it's not good to block a feature that people ask for (my whole company, 200+). Why not just sitting together with the WebEssentials Team and make it possible instead blaming the other team for beeing reluctant?

I hope it's possible to work on that, thanks.

SeriousM wrote May 20 at 9:10 AM

superb, can't even modify my comment... sorry for the headliner-style, should be "hash-1:" ...

jamesnw wrote May 20 at 5:57 PM

  1. I know. ;)
  2. I agree - which is why I said "At the very least...". My original comment is clearly FOR nesting. ;)