teambit / bit.envs

DEPRECATED - Bit compilers and testers were moved to https://github.com/teambit/envs
https://bit.dev/bit/envs
Other
23 stars 9 forks source link

Typescript compiler to emit declaration files #8

Closed jcguarinpenaranda closed 4 years ago

jcguarinpenaranda commented 5 years ago

Hello,

I am using Bit to separate several modules I have written in Typescript. So far, so good, but there is something that I find its missing.

When you build the Typescript code, there are no declaration files emitted (.d.ts files). This means that when you are consuming a Typescript bundled code with Bit, there are no hints or suggestions on the code (very useful in editors like VSCode), which means one has to go to the main documentation (first create one) and see how to use the code.

Please, add a way to emit .d.ts files when compiling Typescript code

qballer commented 5 years ago

This issue happens because our current compiler uses a low level API which can't emit declarations. You can see the bulk of the work in our new environments here .

related to: https://github.com/teambit/bit/issues/1156

WassimBenzarti commented 5 years ago

I modified the Typescript compiler in order to emit the declaration files. It's still under development. You can check out the compiler here.

GiladShoham commented 5 years ago

@WassimBenzarti Sorry for the long reply. That's awesome! Thanks! I've created a version based on your version here. The main issue with this is performance. I'm working in order to solve the performance issue.

WassimBenzarti commented 5 years ago

The main issue with this is performance.

@GiladShoham I totally agree.

williamluke4 commented 5 years ago

@GiladShoham Is your compiler usable?

GiladShoham commented 5 years ago

@williamluke4 Yes, but for a large number of components, it will be very slow. I'm working on a solution to make it much faster but it requires more APIs by bit CLI itself, so it will take some time.

williamluke4 commented 5 years ago

@williamluke4 Yes, but for a large number of components, it will be very slow.

@GiladShoham Yep just encountered this. Still building after 4 mins

qballer commented 5 years ago

We released a new typescript compiler which emits d.ts files. It's speed should improve in the future but it can be used today if you would like.

https://bit.dev/bit/envs/compilers/typescript