Skip to content
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

Everything is named default: re-exports don't use alias #26

Open
camsjams opened this issue Nov 8, 2022 · 1 comment
Open

Everything is named default: re-exports don't use alias #26

camsjams opened this issue Nov 8, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@camsjams
Copy link

camsjams commented Nov 8, 2022

Describe the bug
Re-exported default exports don't maintain nice names from alias

To Reproduce
Steps to reproduce the behavior:

  • create a monorepo
  • in one package, create multiple files that export default
  • in same package, make an index file that re-exports these with nice names, ie export { default as Coder } from './coders/my-coder';
  • generate ts-docs using the entry point that points to same index

Expected behavior
A list of the alias names used.

Screenshots
image

@camsjams camsjams added the bug Something isn't working label Nov 8, 2022
@GoogleFeud
Copy link
Member

Thanks for the issue! When ts-docs finds an export, it doesn't use the name alias for anything, it instead visits the file the exports are from and uses the names from there, and it results in this.

To be honest, default exports weren't given much thought when I was writing the export resolution code, and I think them getting the name from the export alias is a good idea, although what would happen in this case?:

export { default as Something } from "./something1";
export { default as Something1 } from "./something1";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants