jbaron / cats

Code Assistant for TypeScript
Apache License 2.0
408 stars 66 forks source link

Output to Directory is not working on CATS 1.5.3 #153

Closed dtrillo closed 9 years ago

dtrillo commented 9 years ago

If you write a directory for output where you create your JS files, in version 1.4 it's OK, but in 1.5.3, it also creates a TS dir. Please, fix this bug because the place where JS files should be saved is not correct!

If your TS files are in one dir, and the output are in a different dir, the .map file is not linking correctly, because it hopes that the TS file will be in the same dir than the JS and MAP file. The question I have is: the .map file is generated by the compiler or by CATS? If it's the second case, maybe this issue is somthing you can check. I mainly do this because I would like to have in separate dirs the TS and the Js files, but they are not connected when debugging, because the .MAP file is now finding the TS file.

I hope this helps!

jbaron commented 9 years ago

Thanks, will have a look at it.

About your question regarding map files, it is TS compiler that creates them. This is all done in the worker thread (so in the background). After that is done all the files are send back to the UI thread and written to disk (this cannot be done from the worker thread because nodes functions are only available in the UI thread). In project.ts the build method has this logic.

jbaron commented 9 years ago

Cleaned up some compiler stuff and at my machine (OSX) it is working ok (including the mapping files). Few remarks:

Specify the source for the project (project->settings->generic), in my test: src/*/.ts Specify the output dir (project->settings->compiler), in my test caste: build

And you should be fine. If still doesn't work, would be great if you could share a sample were it goes wrong.