-
-
Notifications
You must be signed in to change notification settings - Fork 28
Proper import/export filter #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@anion155, these are a lot of changes, care to explain the process?
|
Yep. I really wanted to discuss this, but it's hard without the code. So it's more like suggestion. Manually changing text is not really good solution, types-only exports not filtered as in vanilla ts, which makes them stay in result file as import side effects. So, I did search how this module declarations handled in compiller. As you can see in previous link it is made by transformer, so I just copied filter logic over here. But I can't keep silent about resolver, it is internal api in ts compiller. It could become a problem in future. But it can be easily guarded. What if leave imports as is it is now ( |
What's the difference between the imports and the exports? |
Types-only re-export does not getting filtered. In tests/utiles/types-only.ts uncomment throw row and tests will fail, cause this module will be imported at runtime. |
Actually that's because of the modified tests/utils/index.ts
@@ -1,3 +1,3 @@
export * from "@utils/sum";
export * from "@utils/subs";
-export * from "@utils/types-only";
+export { NoRuntimecodeHere } from "@utils/types-only"; changing from EDIT: Apparently it only happens with the |
Did not thought about that. Will update pr. |
I've used previous version of visit and added filter of types-only star re-export declarations. And used |
@anion155, there are some conflicts with the other branches. Also, could we keep the output of the tests in a separate directory like before in |
@anion155, could you upload the original PR?, github doesn't allow me to fetch a previous commit. |
closed in #17 |
Have found the way ts filters declarations. Did replicate it. Source.