-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Referenced types and renamings #286
Comments
I thought we have a logic not to export items if their "public" name if different from internal 🤔 do you have a repro when it doesn't work? |
Sure. You can check this commit Atrue@a94d3b3 The output file is: ...
export interface Hidden {
type?: typeof hidden;
}
...
export interface Hidden$1 {
type?: typeof hidden$1;
} The interface Hidden {
type?: typeof hidden;
}
...
interface Hidden$1 {
type?: typeof hidden$1;
} But the idea is to have the second variant as default as I don't think there is a reason to export something like |
Released in https://github.com/timocov/dts-bundle-generator/releases/tag/v9.2.3 just now. |
I hope this is what you'd expect @Atrue ? It feels like this behavior at least fixes the wrong output in case of |
Not sure It’s what’s I expected. Atrue@4ca6b59 The result is really unexpected I’ll try to describe the problem here, as we are here in the same context:
|
@Atrue thanks for the detailed explanation! I'm tempted to agree with you. I agree that having enabled by default feature that provides unpredictable output is not the best DX and it should be disabled. But on addition to that, I see that just having a feature that is not experimental and provides unpredictable output isn't good either. So what I'm thinking about right now is the following:
It feels like when a user's intention was to enable a feature then this feature should be stricter and fail the build if user's desire cannot be satisfied. What do you think? |
Sounds great. Thanks! |
It’s kind of duplicate of #153 but I’d like to bring it up again.
Since there is a new collision-resolver feature, some types\enums\variables have a new name in a final file (like
export type Type$1 = string
). The main idea is to have a main TS logic works properly inside a d.ts file and to export only the result of this logic. So it looks like these types should be hidden by default.For example, it may confuse someone if some autocomplete tools in an IDE suggest something like
do you want to import Type$1 from ‘lib’?
I know about the
exportReferencedTypes
flag, but according to the above I think there are no much sense of this feature and maybe it’s better to remove it at all (make it false) or to disable it by defaultThe text was updated successfully, but these errors were encountered: