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

With default class export. default become the import name. #163

Open
chomosuke opened this issue Dec 4, 2021 · 1 comment
Open

With default class export. default become the import name. #163

chomosuke opened this issue Dec 4, 2021 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@chomosuke
Copy link
Collaborator

I noticed this when I had a class that was a default export. So I wrote a test to try to debug it. Here's the behavior I got
image
Does anyone have any idea why this is happening and how can I fix it? I'd be more than happy to make a pr for this.

Also, what are people's thoughts on splitting the currently massive index.ts file into multiple smaller files. I think that'll make code navigation significantly easier. Also happy to make a pr for this.

@chomosuke chomosuke added bug Something isn't working help wanted Extra attention is needed labels Dec 4, 2021
@rhys-vdw
Copy link
Owner

rhys-vdw commented Dec 5, 2021

Does anyone have any idea why this is happening and how can I fix it? I'd be more than happy to make a pr for this.

Not off the top of my head. The default export should be the camel cased name of the file and should not error. It's possible that this is caused by an upstream error. Kind of surprised we never added tests for a default export.

Also, what are people's thoughts on splitting the currently massive index.ts file into multiple smaller files. I think that'll make code navigation significantly easier. Also happy to make a pr for this.

Yeah, I think if there are any individual helpers that are convenient to split out that would be a good place to start. Some of the functions take way too many arguments too. I can imagine a refactor where we have one object that is the file builder and has functions like "add function" "add constant" etc etc, and the actual type checking logic is elsewhere.

I'm a little apprehensive to give the green light in case I don't like the refactor, but I think some initial steps in that direction would be good. Please do the refactoring as a separate PR though. Perhaps fix this issue first then refactor after?

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

No branches or pull requests

2 participants